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

Автор Akuver, история, 4 года назад, По-английски

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.

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

»
4 года назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

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