First of all, there are cases when a wolf is located at (0, 0), contrary to the problem description. (I have checked this with assert). My program would then return 0 (which is the logical answer), but there should be no such cases (for those of you who got AC, what would your program return?).
Secondly, I am pretty sure my code is correct, but when I write an assert to make sure the result is smaller than 2^32, it fails. Should we truncate the answer to a 32-bit integer or what?
Here goes my code:
Code: Select all