Блог пользователя maroonrk

Автор maroonrk, история, 3 года назад, По-английски

We will hold AtCoder Regular Contest 156.

The point values will be 400-500-600-700-800-1000.

We are looking forward to your participation!

  • Проголосовать: нравится
  • +128
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

I hope the problems of this contest have fewer corner cases.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +46 Проголосовать: не нравится

Amazing round.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

hope everyone get good rating

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Amazing round.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

cpp 20 when

»
3 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Good luck! (I still have $$$+\infty$$$ homework)

»
3 года назад, скрыть # |
 
Проголосовать: нравится +47 Проголосовать: не нравится
  1. Thank you for the contest! Today I learned that Lucas's theorem works for multinomial coefficients too.
  2. Why in the first two problems N is large but for some reason in the third one it’s small? I was doubting whether my linear solution was correct for a long time…
»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How to solve the problem B?

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    Hint 1:
    Hint 2:
  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится +6 Проголосовать: не нравится

    Assume, the mex of the final set is $$$x$$$. In this case, all numbers less than $$$x$$$ are in set. The ones, that are not, have to be added. Assume, we added $$$y$$$ of such numbers.

    Now, we have to add $$$k - y$$$ more numbers. These are numbers from $$$0$$$ to $$$x - 1$$$. We are counting number of sets, so we have to "find number of non-decreasing arrays of length $$$k - y$$$ with elements from $$$0$$$ to $$$x - 1$$$". Now, not easy combinatorial step: we have to put $$$x - 1$$$ stages into $$$k - y + 1$$$ positions. This is number of "combinations with repetitions": $$$C_R(k - y + 1, x - 1)$$$. Rewrite as usual combinations: $$$C_R(a, b) = C(a + b - 1, a)$$$.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

How to solve C ?

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится +26 Проголосовать: не нравится

    For an $$$x$$$, define $$$q_x$$$ as the number such that $$$p_{q_x}=x$$$.

    The minimum similarity has to be at least 1, as one can choose path $$$(x,q_x)$$$ to make it 1. So consider constructing a permutation that makes the answer 1.

    Let's consider a leaf $$$x$$$. If this node makes a contribution of 1 to the final answer, than the final path must contain path $$$(x,q_x)$$$. As $$$x$$$ is a leaf, $$$x$$$ will be the first element in the LCS. Then we only need to ensure that there is no other same element after $$$q_x$$$. One simple way to do this is to make $$$q_x$$$ the leaf. Then we get the idea to shuffle the indexes of the leaves. It's not hard to prove that if we do this, any LCS with a leaf will have length of at most 1.

    Then return to the original problem. Note that since leaves will not make any further contribution, we can simply delete them and do the same thing on the resulting tree again and again, until there's only 0/1 nodes left. Then we can do some trivial assignments and the whole process is finished. It can be proved that in this case, the answer is at most 1, which is obviously the best answer we can get.

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

INF corner cases in A

B was good problem

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

anybody cares to explain problem B question not solution ?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится
»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Linear time solution to E. It's nothing inspiring compared to a quadratic time solution, just beating up the quadratic code till it falls in place.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How does the computing of inverses modulo MOD work in this editorial precomputation?

inv.append(-inv[MOD % i] * (MOD // i) % MOD)

Where does this equation inv(x) mod MOD = -inv(MOD mod x) * floor(MOD/x) mod MOD come from?

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Could anyone explain the editorial solution for problem D? It would be of great help...

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why the problem F can be solve in $$$O(n\sqrt{n})$$$ time.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Wander how to write the code that judges the solution for C.

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hi, maroonrk. There is something wrong with sample explanations for problem C. Instead of "For $$$x = (3), y = (P_2)$$$", $$$y$$$ should be $$$(P_3)$$$.