[HELP NEEDED]: Insane Bug in C++20 Solution

Revision en2, by Seferoglu, 2025-10-09 20:16:03

Good evening CodeForces,today I tried solving https://oj.uz/problem/view/JOI16_selling_rna. My code has a very weird behaviour. To start, compiling in C++20 takes so long that I guess oj.uz marks it as compilation error. The same code gets AC in C++17 (and compiles instantly in my machine). See here:

https://oj.uz/submission/1277541 https://oj.uz/submission/1277540

Another weird behavior I encountered while implementing is if you switch the vector nds; with set nds; in the Node struct, and change the push_back's with insert's, it causes an infinite loop I wasn't able to put my finger on. Also if one compiles the set solution with glibcxx, the following error message is produced (which I'm unable to use to my advantage)

Spoiler

Please help me since I had a similar problem with c++20 before at an important exam (I had compilation TLE on cms on a very simple code which I dont have access to rn)

Tags debug, help, runtime, memory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Seferoglu 2025-10-09 21:27:11 4
en3 English Seferoglu 2025-10-09 20:16:35 6
en2 English Seferoglu 2025-10-09 20:16:03 22
en1 English Seferoglu 2025-10-09 20:15:32 1832 Initial revision (published)