Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Strange behavior of C++(s)

Правка en1, от jaglike_makkar, 2021-12-12 16:04:24

I submitted my code for 1612E - Сообщения in different C++ compilers and here are the results:

  1. C++14 — 138535056 — Accepted (1481 ms)
  2. C++17 (64) — 138534883 — TLE (3000 ms)
  3. C++17 — 138534840 — Accepted (1559 ms)
  4. 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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский jaglike_makkar 2021-12-12 16:04:24 851 Initial revision (published)