What Undefined Behaviour am I triggering over here?

Revision en1, by sbansal1999, 2022-10-08 15:07:16

The Problem is this. I made some naive solution which got AC, then I optimized my solution using vectors and I am getting one solution getting WA in C++17 and the same one getting AC in C++20.

AC in C20 175129943

WA in C17 175130535

I for sure know that I am triggering some undefined behavior here or else this wont happen. Maybe its the equality check of vectors using the == operator. But I am not sure.

Thanks.

Tags codeforces, undefined behavior, c++20, c++17

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English sbansal1999 2022-10-08 15:07:47 5 Tiny change: ' operator. But I am n' -> ' operator.\n\nBut I am n'
en1 English sbansal1999 2022-10-08 15:07:16 556 Initial revision (published)