Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

Why am I getting out of bounds error?

Revision en1, by CandidFlakes, 2023-08-21 19:13:23

Please look at this submission. I am getting out of bounds error on line number 42. I have checked my code multiple times and also made sure that the vector 'a' is accessed up to i=a.size()-2 only, so that a[i+1] doesn't go out of bound.

Please help me identify my mistake.

I will be thankful for any help!

Tags runtime error, mysterious runtime error, out of bound, out of bounds

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English CandidFlakes 2023-08-21 19:13:23 412 Initial revision (published)