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

Автор whybee, история, 6 лет назад, По-английски

While solving the problem http://codeforces.com/contest/264/problem/A I submitted the solution but it's giving RTE on test case 41. Any help?

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

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

You have undefined behavior from line 24 to 27. When "left" is empty, you are trying to access out-of-range element.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    That was it! thank you so much :) If you see an RTE what things do you have in mind to check (if its a segmentation fault, we see invalid memory access) generally?