Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

codeomaniac2022's blog

By codeomaniac2022, history, 9 days ago, In English

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:

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

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

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].

  • »
    »
    8 days ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    But the result should be identical.

    First Round
    get(arr[0], arr[2]) = 2
    get(arr[4], arr[6]) = 1

    newArr = [arr[1], arr[2], arr[4], arr[5]] = [0, 3, 2, 0]

    Second Round
    get(arr[1], arr[4]) = 2

    newArr = [arr[2], arr[4]]

    Third Round
    get(arr[2], arr[4]) = 1

    Winner = arr[2]

    Output for your example: