About a submission that i have made in code forces | Sololearn: Learn to code for FREE!

+1

About a submission that i have made in code forces

In the same problem at first I submitted this solution: https://codeforces.com/contest/1620/submission/142528587 then the only thing that I changed is that I included usigned long long int and the results changed drastically why?? second code: https://codeforces.com/contest/1620/submission/142528959

1/12/2022 3:58:16 PM

Nazeefa Labiba

1 Answer

New Answer

+1

If any of the difference calculations should result in a negative number, then it will cause an underflow in the unsigned version and the max() results will be quite different.