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

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

Can some explain why answer

0 0 0 0 1

for Test Case 2 [5 2 2], in the example test case, is not being accepted as an answer.

Problem:

https://codeforces.me/contest/2084/problem/D

You can also check my submission for reference:

Submission

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

»
16 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +1 Проголосовать: не нравится

You can erase the first two numbers. Now you have [0, 0, 1]. Erase the first two numbers again and you obtain [1], whose mex is 0. But the maximum is 1 (for example in the array [0, 1, 0, 1, 0], where you will always end with a [0], whose mex is 1).