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

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

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.

Полный текст и комментарии »

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