Akuver's blog

By Akuver, history, 4 years ago, In English

Here is my solution for the problem 6B(https://codeforces.com/contest/6/problem/B): https://codeforces.com/contest/6/submission/71870236 On my machine when I enter the sample test case, I get the correct answer. However, codeforces shows answer as 3 for my code instead of 2. Help me with the issue.

  • Vote: I like it
  • -9
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +13 Vote: I do not like it

You are looking at row $$$i+1$$$ before reading it, at line 18, that's undefined behavior and anything can happen.