When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

Singular Iterator Runtime Error

Revision en3, by TheLethalCode, 2020-07-11 08:14:39

In my hundreds of submissions, this is my first time encountering this Singular Iterator Runtime Error. In my submission 86437246, after passing the first few cases and when it encounters a relatively bigger input, the program exits with a RE. After looking at the diagnostic hints, I think it has something to do with singular iterators ( which is sort of equivalent to uninitialized pointers ), though I couldn't pinpoint where. But if I were to make a guess, I would say vector< pair< int, int > > which[1050] should be the source of the problem as after using some alternatives for it, I managed to get my solution accepted (86437933).

It would be very helpful if someone can throw some light on where I went wrong, so that I could avoid this in my future submissions.

**UPD:- ** It is a normal out of bounds error. Increasing the size of vis array takes care of it. Corrected submission — 86473660. Thanks WAontest2

Thanks a lot!

Tags mysterious runtime error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English TheLethalCode 2020-07-11 08:14:39 190
en2 English TheLethalCode 2020-07-10 22:05:38 0 (published)
en1 English TheLethalCode 2020-07-10 22:04:40 855 Initial revision (saved to drafts)