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

Автор Rafi, 18 месяцев назад, По-английски

I have submitted the following code in c++14, where I used policy based data structure(pbds), which didn't passed due to tle in the system test. In c++17, the result is also tle.
problem link: https://codeforces.com/contest/1794/problem/C
submission link:https://codeforces.com/contest/1794/submission/196039857

But I submitted the same code with c++20(64 bit, winlibs) and got accepted.
submission link: https://codeforces.com/contest/1794/submission/196061031

What is the reason? Can anyone help?

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

»
18 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It may be due to some compiler optimizations in the newer compiler that may have better optimization techniques that can make the code run faster, thus avoiding the TLE error.

Refer to the blog for more understanding.

Click Here

»
18 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

the simple reason is that 64bit runs much faster than 32bit

»
18 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

that is the reason i used c++20