I submitted my code for 1612E - Messages in different C++ compilers and here are the results:
- C++14 — 138535056 — Accepted (1481 ms)
- C++17 (64) — 138534883 — TLE (3000 ms)
- C++17 — 138534840 — Accepted (1559 ms)
- C++20 (64) 138534744 — TLE (3000 ms)
All 4 are the same codes. I can understand that there can be minor differences in time taken, but here the difference is around 1.5 ms. I mostly code in python and don't have much idea on performance differences between different C++ compilers.
As far as I can think, int
operations are faster in C++ while long long
operations are faster in C++ (64). But still, the difference is huge. Is there any other reason and how to decide appropriate C++ compiler?