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

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

We will hold AtCoder Grand Contest 064. This contest counts for GP30 scores.

The point values will be 400-600-900-900-1300-1700.

We are looking forward to your participation!

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

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

Hey, can anyone check my submission for A here. Maybe I understood the problem incorrectly, as I even validated the code based on my understanding.

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

    The difference of the first and last element should also fulfill the second condition. Read the 2nd condition carefully. It is mentioned there. Additionally, if you check the sample test case explanation, on the last line you will see your mistake.

    P.S. I made the same mistake initially.
    
»
16 месяцев назад, # |
Rev. 3   Проголосовать: нравится +11 Проголосовать: не нравится

About problem C: this submission 's computational complexity seems $$$O(n ^ 2 \log r_n \log n)$$$(the use of map<vector<pair<ll, ll>>, bool>), but it passes all the testdatas.

So I'm curious about the real complexity.

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

I have a doubt on jiangly's code.

On line 84, shouldn't it be for (int i = 0; i < M; i++) {? And on line 86, shouldn't it be ans.push_back(i);? On line 100, I think it should be for (int i = 0; i < M; i++) { as well. Maybe I have misunderstood the code, but changing the three lines to the ones above gives AC as well.

The code after modifying.

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

    You are right in the sense that those lines don't make sense. But actually, just those recursive checks in the beginning are needed to solve the problem. The code with 2 weird loops removed

    I can only guess, but it feels like jiangly changed his mind about the solution midway, and just forgot to remove obsolete code (or maybe he thought about it and understood that it wouldn't change how the code behaves, but that seems unlikely, as this is not that obvious and would probably take more time than just deleting two blocks of code).

    In any case, nice catch!