Yath's blog

By Yath, history, 4 years ago, In English

I am getting WA in Test case 2, particularly : wrong answer 35th numbers differ — expected: '1', found: '0'. I am unable to find the error in my code for this problem: 1622C - Set or Decrease My submission:193454039. The logic I used:

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

»
4 years ago, hide # |
← Rev. 2  
Vote: I like it +4 Vote: I do not like it

Hi Yath, there is a subtle mistake. The $$$x$$$ in your code is not guaranteed to be $$$ \leq v[0]$$$, so you should add a line x = min(x, v[0]) after the x-- line.

https://codeforces.me/contest/1622/submission/193539783