KingPowers's blog

By KingPowers, history, 2 weeks ago, In English

https://codeforces.net/contest/666/submission/299989066

https://codeforces.net/contest/666/submission/299988231

As you can see, these are two submission records. The code in both submissions is exactly the same (using Compare shows no differences, not even a single red line). The only difference is that for the first submission, the language chosen was C++20, while for the second submission, it was C++23. However, this difference caused the first submission to result in a TLE at 6000ms, while the second submission ran in just 800ms and passed successfully.

What could be causing this discrepancy? I suspect that there might be Undefined Behavior in my code, but I haven’t been able to identify the specific line causing the issue.

If you can help pinpoint the problem in my code or identify another reasonable explanation, I would greatly appreciate it!

Full text and comments »

  • Vote: I like it
  • +64
  • Vote: I do not like it