Can someone explain to me how this was casted to long long?

Revision en1, by Leonardo_Paes, 2025-12-31 02:13:28

In last educational problem C, I submitted what I thought was a wrong code (I even resubmmited shortly after). I didn't declare my answer variable as a long long, even though the worst case is 5000^3 which exceeds 10^10. Here is my code https://codeforces.me/contest/2182/submission/355744056

I suspect something weird is happening in the last cout, where the compiler is treating it as a long long, even though there is an int and an unsigned int being multiplied.

Any help is appreciated!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Leonardo_Paes 2025-12-31 02:13:28 556 Initial revision (published)