Hello,
My friend 53645 was trying to solve Problem 348A - Mafia and after getting lots of Wrong Answer he changed a few variables from long long to int and got Accepted.
Can anyone please explain what happened? We couldn't find an explanation.
Wrong answer using long long: 4600792
Accepted using int: 4600933
You can use Diffnow to see the difference in both codes highlighted.
Thanks!.
The change from long long to int was not the reason why he go AC. He go AC because he lowered initial value of long long hi.
In function check(v) there is variable cnt, whicn can be up to v*n. It overflowed with too big hi.
I can't believe we never thought about that.. Thanks a lot Fefer_Ivan