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

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

Hi.

I need one help in D. I submitted the same solution with just a small interchange. But I couldn't get why the one that is failing is wrong. Can anyone help?

Wrong Submission: https://codeforces.com/contest/1713/submission/167301158

Correct Submission: https://codeforces.com/contest/1713/submission/167315386

Difference:

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

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

In the case where arr = [1,0,3,0,2,0,1,0], we will incorrectly compare curr[1] to curr[4] instead of comparing curr[2] to curr[4].