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

Автор antontrygubO_o, 4 года назад, По-английски

I am glad to invite you to AtCoder Grand Contest 052. This contest counts for GP30 scores.

I would like to thank:

Statements are very short, and I really hope you will like the problems.

We are looking forward to your participation!

UPD 1: The point values will be 400-800-1000-1000-1500-2000, and the duration is decided to be 160 minutes

UPD 2: Congratulations to the winners!

  1. ksun48
  2. mnbvmar
  3. tourist
  4. Benq
  5. Radewoosh

Thanks for your participation :P

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

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

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

Can we say "All hail our emperor anton" here?

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

Why is it 1200+ rated , I am new to atcoder and currently brown , I was waiting for this for a week until I came to knew that it is 1200+ rated (Today) . I know I can participate unofficially but still rated contest have their own charm , This is not right to make them rated for 1200+ according to me . Y have a lower threshold?

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

Finally our emperor created a round on his favourate website with his favourate problems. :qq:

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

As a tester (my only comment as tester so far, despite having tested other rounds), this round seems inspired and I'm amazed at the quality of problems. I would highly recommend participating to have your mind blown.

P.S. All hail our emperor Anton

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

How many problems did you propose in order to get 6 accepted?

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

    9, but mostly to fix the difficulty balance

    • »
      »
      »
      4 года назад, # ^ |
      Rev. 2   Проголосовать: нравится -41 Проголосовать: не нравится

      It was meant to be joke. I would like to sincerely apologize to Anton. You are among the people whose name is enough in announcement to keep me awake at 1am during some contests. Sorry!

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

        The coordinator rejects bad problems. If you propose $$$100$$$ bad problems, most of them will be rejected. If you propose $$$6$$$ good problems, most of them will be accepted.

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

Every time I read problem A of any AGC, I question my existence...

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

I can stare at a problem only for so long. someone pls tell how to solve B after contest ends

Edit: Editorial out right after contest. Thanks!

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

This contest was genius and it was 100% worth destroying my sleep schedule to fail on it. All hail our emperor Anton.

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

tfw you know how to solve C but are just a bit too slow because you thought you could squeeze in a slower solution

Also fun fact: I figured out B when I thought about what happens if the tree is a star — if we consider everything XOR'd by $$$X$$$, then $$$(w_1 \oplus X, w_2 \oplus X, \ldots, w_k \oplus X)$$$ changes to $$$(w_1 \oplus X \oplus (w_2 \oplus X), 0 \oplus w_2 \oplus X, \ldots, w_k \oplus X \oplus (w_2 \oplus X))$$$, which is $$$(w_1 \oplus w_2, X \oplus w_2, \ldots, w_k \oplus w_2)$$$, so $$$w_2$$$ and $$$X$$$ only swap places. From that, I intuited that we must be able to add a variable and convert the problem to swapping, and what's a better extra variable than a vertex weight! Kinda roundabout, but a natural way to look at a problem — look at a specific case and generalise.

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

    I have a question how can we prove that W can be generated after doing the operation any number of times

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

Show some mercy, it was so hard ;_;

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

After solving A, I was like: "Thanks for cyberbulling"

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится -17 Проголосовать: не нравится

    Can't agree more. I was only able to solve it coz I saw jiangly solved it under 4 min, so thought of some constructive approach.

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

After reading the editorial, I realize that I completely misread problem B during the contest. I thought it was $$$w := w_1 \oplus w$$$ instead of $$$w_1 := w_1 \oplus w$$$. In hindsight I forgot to apply the rule of thumb that pronouns are usually intended to have the most recent possible referent, or could have noticed the potential ambiguity and asked for clarification. But the wording of this problem could definitely have been improved to avoid this issue.

Still, nice contest! C, D, E were all very nice problems, and I might well have liked B if I understood it. F seems above my pay grade (but that's not a bad thing), and I would have liked if A's solution was more interesting (but it's not a bad problem).

Hopefully your next contest will be rated for me.

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

    I also misread problem B exactly like you.

    And I have a very short solution for that problem.

    Let $$$f_u$$$ be sum xor of all edge's weight that is incident to u. We can see that after operation $$$(u, v)$$$, $$$f_u$$$ and $$$f_v$$$ are swapped.

    So we can prepare multiset of $$$ms_1$$$ of all $$$f_u$$$ in the beginning, and $$$ms_2$$$ of all $$$f_u$$$ in the end. It's "YES" if $$$ms_1 == ms_2$$$ and "NO" otherwise.

    It took me 20 minutes :(

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

I have a different approach for task E :

Consider $$$a_i=[(s_{i+1}-s_i)\bmod 3 = 1]$$$. Changing a letter in the middle is equivalent to swapping two consecutive elements in $$$a$$$, and changing the first or the last letter is equivalent to changing the first of the last element in $$$a$$$. It's easy to see that if you changed $$$a_1$$$ from $$$0$$$ to $$$1$$$, you will never change $$$a_1$$$ from $$$1$$$ to $$$0$$$. (However, it could be moved to the end and changed as $$$a_{n-1}$$$, but it seems this could happen only when $$$n\le 3$$$ or all $$$a_i$$$ are equal, though I didn't prove it)

Iterate how many times you changed $$$a_0$$$ from $$$0$$$ to $$$1$$$ (or from $$$1$$$ to $$$0$$$), suppose the number is $$$x$$$. $$$x$$$ should be equal to $$$t_0-s_0$$$ modulo $$$3$$$. For each $$$x$$$ you could calculate the answer in $$$O(n)$$$. It turns out the answer is a convex function of $$$x$$$, thus the minimum can be calculated in $$$O(n\log n)$$$ using ternary search.

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

    How to prove the ternary search?

    • »
      »
      »
      4 года назад, # ^ |
      Rev. 2   Проголосовать: нравится +17 Проголосовать: не нравится

      Suppose you got the arrays $$$a$$$ from $$$s$$$ and $$$b$$$ from $$$t$$$, let $$$p_i$$$ is the $$$i$$$-th $$$1$$$ in $$$a$$$, and $$$q_i$$$ is the $$$i$$$-th $$$1$$$ in $$$b$$$. Add infinite $$$0$$$ to at the beginning of $$$p$$$ and $$$q$$$ and infinite $$$n$$$ at the end, then the answer for a given $$$x$$$ is

      $$$ \sum_{i=-\infty}^\infty |p_{i+x}-q_i| $$$

      which is convex. ($$$|x-y|=\sum_v |[x>v]-[y>v]|$$$, so you only need to consider a special case where all numbers are $$$0$$$ or $$$1$$$, where the answer is $$$|x-\mathrm{Constant}|$$$)

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

In the proof of sufficiency of max limit of number of 1's in Problem C's editorial, I think the claim that if $$$y$$$ was the most frequent at some time then at any later time for any element $$$z$$$ (number of $$$z$$$'s)<=(number of $$$y$$$'s+1) is not correct. Here's an example of the algorithm applied on the array $$$[1,1,2,2,4,4]$$$ with $$$P=5$$$.

Pick any $$$x$$$ having max frequency so I pick $$$1$$$ in the first move. In the second move max frequency occurs for both $$$2$$$ and $$$4$$$ but I choose to let $$$x=4$$$. However $$$1+4$$$ is divisible by $$$5$$$, so I pick $$$y=1$$$ and thus the elements picked by me are $$$1$$$ $$$1$$$ $$$4$$$ in that order.

However now I observe that elements left with me are $$$[2,2,4]$$$, the frequency of $$$2$$$ is $$$2$$$, while frequency of $$$1$$$ is $$$0$$$. But I had picked $$$1$$$ in the first move so the frequency of $$$2$$$($$$=2$$$) should not have exceeded frequency of $$$1+1$$$($$$=1$$$). But this is a contradiction.

If I have understood anything incorrectly in editorial please let me know. I think letting $$$y$$$ to be random if $$$cur+x$$$ is divisible by $$$P$$$ is causing problem.