Блог пользователя KingPowers

Автор KingPowers, история, 44 часа назад, По-английски

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

https://codeforces.me/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!

  • Проголосовать: нравится
  • +61
  • Проголосовать: не нравится

»
43 часа назад, # |
  Проголосовать: нравится -53 Проголосовать: не нравится
#define For(i, a, b) for(int i = (a); i <= (b); i++)
#define Rof(i, a, b) for(int i = (a); i >= (b); i--)

😳

»
37 часов назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

I think this might be related to the static initialization sequencing problem that peltorator faced recently.

But that involved template programming, so I'm not sure what causes this.

»
37 часов назад, # |
  Проголосовать: нравится -19 Проголосовать: не нравится

judger fluctuation

»
37 часов назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

It is because you used different GNUs. It happens, but I don't know why it happens.

»
32 часа назад, # |
Rev. 2   Проголосовать: нравится +17 Проголосовать: не нравится

I'm sure that the e array forms a death vector causing the cin to be abnormally slow, there is no UB involved. i created a test myself and found that it took 7000ms just to read in all the input.

code i used for check
»
32 часа назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

peltorator come you like this shit

»
18 часов назад, # |
  Проголосовать: нравится -12 Проголосовать: не нравится

They Do Not Produce Different Result Just Uses Different Time To Run

»
15 часов назад, # |
Rev. 2   Проголосовать: нравится -10 Проголосовать: не нравится

Newer versions of everything provide improvements and bug fixes!