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

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

AtCoder Grand Contest 024 will be held on Sunday (time). The writer is DEGwer. This contest counts for GP30 scores.

Contest Link

Contest Announcement

Contest duration: 130 minutes

The point values will be 300 — 500 — 700 — 1100 — 1200 — 2300.

Let's discuss problems after the contest.

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

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

5 minutes before the contest start :)

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

I'm getting WA on 3 tests out of 107 in D. Seriously?

UPD: tests 17, 19, 49. What are they? And my answer for N=2 is "1 2", which should be correct.

UPD2: It wasn't a corner case. I was editing the representation of the original graph instead of its copy — now I'm surprised that passed 104 tests instead of ~50 out of 107.

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

What happened to khsoo01 at AGC024?

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

Now this is interesting.

jcvb's only submission in the contest, https://beta.atcoder.jp/contests/agc024/submissions/2540895, submitted 9 seconds before the end of the contest, has been WJ for more than 7 minutes now.

This will determine whether he will get 0 points or 2300 points.

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

English translation of editorial for D isn't finished yet.

Also, statement for D should be more clear. I thought that I can only add one vertex to the tree and was like "How could such a pointless problem appear in Grand Contest?".

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

    I thought so too, which is why I asked for clarification.

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

    We will construct a new tree T by "repeating" the following operation, but was it unclear?

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

      How many times? N times? N - 1 times? An infinite number of times? Once? Is zero times allowed? Yeah, it's unclear; that's why the standard way to write it is "repeating the operation an arbitrary number of times (including zero)".

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

    You can check last sample, it's impossible to get 12 leafs, after one operation on tree with 8 leafs.

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

Can someone please explain how to do problem C of the contest? The editorial is in Japanese! Thanks :)

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

    Sorry, we'll add English A-D later.

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

    How to solve B? Also, are the test cases visible? Sorry, but I am new to the site

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

      You have to find the longest subsequence of consecutive values (values are consecutive, not their location in the array). When you move all the elements that are not in this subsequence to either the beginning or end, they will "bubble" together. For example, say the array was 2 5 3 1 4. Then, 2 _ 3 _ 4 is the longest such sequence. If we move 1 to the beginning and 5 to the end, then the sequence will come together and we will have 1 2 3 4 5.

      We simply find the length of this sequence and subtract the length from n.

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

    Note that if ai > ai - 1 + 1, then it is impossible (this follows from the fact that after any operation on an element, that element can never decrease, and at some point for nonzero ai, ai - 1 needed to be equal to ai - 1. Also, if ai > 0 or generally if ai > i - 1, it is impossible, since those are the maximum values those elements can achieve.

    Then, we see that for any contiguous segment of increasing numbers, the minimum number of operations needed to get that segment is equal to the highest value in the segment (i.e. if your segment is 0 1 2 3, you need 3 operations to get to that. If your segment is 3 4 5, you will have needed 5 operations, regardless of what the values before 3 are). Thus, for each contiguous segment with increasing values, we can add the highest value of the segment to our answer.

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

Thanks for another great contest!

Could you also update https://docs.google.com/spreadsheets/d/1T-hKu_vIh8l4EiW6XTWOvP0evzsWj0f45JNNgou21Cc/edit#gid=695896678 with AGC 023 and AGC 024?

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

What is the expected solution for Problem C?

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

Just want to say that AtCoder is quickly becoming one of my favorite platforms because you all manage to make really good problems without a reliance on advanced data structure/algorithm knowledge, but rather with a reliance on thinking cleverly. This contest was obviously quite difficult (as all AGC's are), but I think from reading the editorial that the most advanced algorithm concepts were DP and finding the diameter of a tree, which are covered in like basic algorithm/data structure classes. That is very impressive.