Same code gets diffrent verdict between C++17 and C++20

Revision en2, by DisconnectedGraph, 2024-07-29 12:10:30

When I'm solving 1303G, I submitted with C++17 and C++20(same code).

In C++17, the code passes test 2 easily (109ms).

However, the code gets TLE in C++20 (time limit is 6s).

I'm confused, is there an undefined behavior in my code or is the C++20 compiler bugged?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English DisconnectedGraph 2024-07-29 12:10:30 13 Tiny change: 'er bugged? Please help.' -> 'er bugged?'
en1 English DisconnectedGraph 2024-07-29 12:10:17 514 Initial revision (published)