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

Автор BARBARIANNNNN, история, 3 года назад, По-английски

There is a strange thing between C++14 and C++20

We can see that the down two code are same, but the code using C++20 got TLE, and the code using C++14 got AC

https://codeforces.me/contest/1634/submission/145631828

https://codeforces.me/contest/1634/submission/145633066

We can also see that the down two code are same, but the code using C++14 got TLE, and the code using C++20 got AC

https://codeforces.me/problemset/submission/573/145373496

https://codeforces.me/problemset/submission/573/145372752

What's wrong with it? It there anyone could help me answer the question? Many Thanks!

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

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

in the second case, it is due to the 64-bit version of the compiler.

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

C++20(64-bit) is absolutely faster than C++20.

One of my friends named EasonTAO debugged the whole night and submitted for 94 times and got all TLE because he used C++20. Later he used C++20(64-bit) and submitted the same code and got AC.

It was really surprising.

Here is his submission.

143979222

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

EasonTAO, yyds!