nolifeblackbird's blog

By nolifeblackbird, history, 5 hours ago, In English

Yesterday, I have participated in the Codeforces Round 969 (Div. 2), and I have realised that the task A was easier than B.

For task A (Dora's Set), you had to know that for any natural number x, gcd(x, x+1)=1, and for any odd number x, gcd(x, x+2)=1. Because of that, if x is an odd number, than the three distinct integers that satisfy the conditions would be x, x+1 and x+2. And thus you can find the answer (l-r+1)/4 which is increased by 1 in some cases.

For task B (Index and Maximum Value), you only had to realise that no number is gonna pass the biggest number because before it passes it, it has to become equal to the biggest number, but when it becomes equal then in any operation that the biggest number was increased, that number is also gonna be increased. Because of that we can only see in which operations the biggest number was increased or desreased, perform those operations on that number and we get the answer.

So for task A you had to know math which is not really easy, and for task B you just had to realise what I explained (if you didn't understand me, you can see the editorial), which is not harder than the math in A.

My question is: Can someone please explain why A was placed before B? Thank you for advance for your answers.

  • Vote: I like it
  • -17
  • Vote: I do not like it

»
5 hours ago, # |
Rev. 2   Vote: I like it -7 Vote: I do not like it

A still has more accepted submissions* though...

  • »
    »
    5 hours ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Hmm... yeah you're right. I haven't looked at that...

  • »
    »
    5 hours ago, # ^ |
    Rev. 2   Vote: I like it +2 Vote: I do not like it

    It could be because some people thought B was harder so they solved A and then didn't have time for B though

»
3 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I believe A was not harder but observation was tough part there like thinking of that if any sequence of 3 starting from odd will result in gcd of 1 and that count will be only the max is definitely tough.

»
3 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

1) Difficulty is subjective. To me personally, $$$\gcd(x, x+1)=1$$$ is common sense and $$$\gcd(x, x+2)=1$$$ for all odd $$$x$$$ is also common sense. However, B wasn't that obvious and I overthought the problem.

2) It's just Codeforces bruh, chill man. It's not that deep lol. The order of the problems isn't the most important thing. The most important thing is that we solve the problems and improve.

3) Rather than whining about unimportant things like problem order, how about you upsolve the problems regardless of their order and focus on doing better on the next contest?

  • »
    »
    116 minutes ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    I'm sorry if this blog upsets you or anything, but I just wanted to see why A was placed before B. I won't post these kind of blogs anymore if it makes you feel better.

  • »
    »
    39 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I was not aware of gcd(x, x + 2) = 1 for all odd x , thanks for the explanation.

»
2 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

I found A harder as well. I didn't prove it during the contest. But thanks to this blog, I discovered a beautiful proof for Euclid's algorithm gcd(a,b) = gcd(a%b, b) using sticks.

»
86 minutes ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Knowing the math is good since in the later problems you are done for if you cannot do it, but I think it will be for the best if A and B are attempted on the basis of observation and intuition. Of course what do I know, I'm just a pupil like you :(

But yes, I agree A was tougher than B.

»
58 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

I solved A by noticing some mysterious connection between $$$\frac{r-l+1}{4}$$$ and the answer in the sample, before I realized I can take as many odd numbers as possible.