Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

Long long is faster than int?
Разница между en3 и en4, 0 символ(ов) изменены
Hi Codeforces,↵
I was trying to solve [this problem](https://cses.fi/problemset/result/15528576/), and I was struggling to see why [my code](https://cses.fi/paste/4046d884034fe61decf22c/) TLEs when other people's code (you can search up cses hamming distance solution for this) passes with similar logic.↵
↵
Turns out when I add `#define int long long`, [my code](https://cses.fi/paste/2131a98eeec6dd80ecf243/) magically passes and becomes quite a bit faster. I am dumbfounded by this phenomenon, and the only explanation that was somewhat reasonable was [this](https://softwareengineering.stackexchange.com/questions/411128/is-using-64-bit-integers-long-long-faster-than-less-bits-ones) (which is still crazy to me).↵
↵
I guess sometimes long long really is faster than int.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский kunzaZa183 2025-12-08 17:06:43 16 I replaced it with the correct link.
en4 Английский kunzaZa183 2025-12-08 14:56:07 0 (published)
en3 Английский kunzaZa183 2025-12-08 14:55:41 64
en2 Английский kunzaZa183 2025-12-08 14:55:00 165
en1 Английский kunzaZa183 2025-12-08 14:54:24 901 Initial revision (saved to drafts)