2031E — Same Code, C++20/23 = Runtime Error, C++17 = AC

Revision en1, by TahsinArafat, 2024-11-15 19:41:54

During Codeforces Round 987 (Div. 2), I got Runtime Error on Test Case 59 (in Problem E. Penchick and Chloe's Trees). It shows Stack Overflow Error! But, the same code got AC on C++17 while upsolving!

  • C++20 Submission: 291655589 — Runtime Error on TC 59
  • C++23 Submission: 291671738 — Runtime Error on TC 61
  • C++17 Submission: 291671684 — AC

But, after a little modification on insider loop, it got AC in C++20: 291668944. But, I couldn't find any valid reason for stack-overflow, and how this submission solved this error!

Can you help me?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English TahsinArafat 2024-11-15 19:41:54 684 Initial revision (published)