Long long is faster than int?

Revision en2, by kunzaZa183, 2025-12-08 14:55:00

Hi Codeforces, I was trying to solve this problem, and I was struggling to see why my code 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 magically passes and becomes quite a bit faster. I am dumbfounded by this phenomenon, and the only explanation that was somewhat reasonable was this (which is crazy to me).

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English kunzaZa183 2025-12-08 17:06:43 16 I replaced it with the correct link.
en4 English kunzaZa183 2025-12-08 14:56:07 0 (published)
en3 English kunzaZa183 2025-12-08 14:55:41 64
en2 English kunzaZa183 2025-12-08 14:55:00 165
en1 English kunzaZa183 2025-12-08 14:54:24 901 Initial revision (saved to drafts)