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

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

PROBLEM LINK:https://mirror.codeforces.com/contest/1468/problem/C

When i am taking int to long long the verdict is :RUNTIME ERROR ON TEST 39 When i am taking int:Its getting accepted

Runtime Error submission Link:https://mirror.codeforces.com/contest/1468/submission/126266278

Accepted Solution Link:https://mirror.codeforces.com/contest/1468/submission/126266726

WHAT IS THE CAUSE OF RUNTIME WHEN I AM TAKING INT TO LONG LONG.Please explain.

I am always take my int to long long.After this incident i will be scared to take int to long long.Please Help

THANKS IN ADVANCE

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

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

If I had to guess, your runtime error could be caused by erasing the beginning of for_monocarp before dereferencing it (calling for_monocarp.erase(it); before int ss = *it;). Erasing an iterator invalidates it, so in general, dereferencing is no longer possible. However, you may have simply been lucky and had no issues from this with your second version.