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

Автор rng_58, история, 6 лет назад, По-английски

We will hold AtCoder Regular Contest 106.

We are looking forward to your participation!

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

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

Bump. ARC soon, fellow S.T.A.L.K.E.R. (Oh really, when? Now.)

Come play if you're a pleb like me and it's still rated for you.

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

I wish the word positive was in bold in problem A :)

How do you solve D? Is there some nice result that comes straight from binomial expansion, or do I have to do some fancy math?

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

What is wrong in my code for problem A..?

https://atcoder.jp/contests/arc106/submissions/17622365

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

The curse of the testcase (1,0).

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

How to solve B?

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

    We break the graph into components. If in a connected component the sum of $$$a_i$$$s is the sum of $$$b_i$$$s, I can win by making $$$a_i=b_i$$$ one by one.

    If the sum of $$$a_i$$$ s is not the sum of $$$b_i$$$ s, the answer is negative because the sum is an invariant.

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

I think this is the first time I used Hall's theorem to successfully solve a problem.

  • »
    »
    6 лет назад, скрыть # ^ |
    ← Rev. 5  
    Проголосовать: нравится +16 Проголосовать: не нравится

    Yeah you use it to solve E, where you consider $$$f(i)=$$$ number of days worker $$$i$$$ can work, and for any subset $$$T$$$ of $$$[n]$$$, the number of days for which at least one worker in $$$T$$$ works is $$$ \ge k|T|$$$.

    So we can binary search and find the answer. Unfortunately, I thought of this for E but ran out of time.

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

      The important thing is that the answer is at most $$$2KN+\mathrm{max}(A_i)$$$, which also follows from the theorem. This means we can bruteforce the exact set of workers on each day and checking the condition for binsearch becomes just doing subset sums on that.

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

        2KN actually. After any time period T, every person will have worked at the very least T/2 time. You take all the times that at least a person in S has worked, which is at least T/2 and needs to be (according to hall) at least NK. I agree that one was the main observation, took me quite some time to get there.

»
6 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +14 Проголосовать: не нравится
Unofficial editorial for F (messy; is there a more elegant solution?)
  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +37 Проголосовать: не нравится

    Here's a combinatorial solution which only uses the fact that trees can be represented as Prufer sequences where degree of a node is equal to number of occurrences plus one:

    For a given tree, consider choosing holes for each edge one by one in arbitrary order. Each time we add an edge to a node $$$i$$$ we must multiply the answer by $$$d_i - s_i$$$ where $$$s_i$$$ is the number of edges previously added to that node. All nodes have degree at least one so take $$$\prod(d_i)$$$ of the initial values first and then decrement all $$$d_i$$$ by one. This way we can simplify the problem to say that the final $$$s_i$$$ is equal to the number of occurrences of $$$i$$$ in the Prufer sequence exactly, and then multiply the original product of $$$d_i$$$ into the answer,

    Now, we claim that the sum of this value across all Prufer sequences is equal to the number of permutations of $$$(\sum(d_i))$$$ of length $$$(N-2)$$$ (remember these $$$d_i$$$ values are the decremented ones). It turns out that there's a nice bijection which shows that fact: imagine that we have balls of $$$N$$$ colors where there are $$$d_i$$$ balls of the $$$i$$$-th color. Then the Prufer sequence count is equivalent to repeatedly choosing a color, then choosing one of the balls of that color, and then removing it ($$$N-2$$$ times total). But the step of choosing a color is irrelevant, so we can just phrase it as choosing $$$N-2$$$ arbitrary balls in order from a set of $$$\sum(d_i)$$$ balls total as desired.

  • »
    »
    6 лет назад, скрыть # ^ |
    ← Rev. 4  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Here is my submission using Prufer code. What I had done is:

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

    Hi... I have heard of the prufer sequences for the first time .. And it seems gr8 , Do you have any other related questions using these type of techniques ? I want to learn them this time . Thanks..

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

how to solve c

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

is there any editorial(official/unofficial) available for the contest?

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

Will an editorial be uploaded anytime soon?

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

Can anyone help me with the problem B, I am getting WA in some cases.

This is my Code in Python https://atcoder.jp/contests/arc106/submissions/17717380