maroonrk's blog

By maroonrk, history, 16 months ago, In English

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!

  • Vote: I like it
  • +161
  • Vote: I do not like it

| Write comment?
»
16 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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 months ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    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 months ago, # |
Rev. 3   Vote: I like it +11 Vote: I do not like it

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 months ago, # |
Rev. 3   Vote: I like it +8 Vote: I do not like it

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 months ago, # ^ |
      Vote: I like it +29 Vote: I do not like it

    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!