Hi CF community!
I was practicing some virtual contests recently and I happened to run into a very peculiar compilation issue. I was trying this problem and for some reason, I kept getting TLE on test case 1, submission here with limit at 2s. It frustrated me to no end because the code is really short and it cannot possibly TLE on the sample test case unless I am losing my mind.
Then, in sheer desperation, I decided to change the compiler to G++17 from G++20, and voila, accepted in like 100ms!
I am not very familiar with the differences in compilation please, can someone educate me on why this happened and how to prevent it in the future? Thank you in advance.