Hi,
I ran into a problem with answers in problemset 486A. My code says — if the number is even then print a half of it otherwise do something else.
Test case is 1 000 000 000 000 000 and "judging bot" or whatever doesn't take it as an even number. When I try the same number in terminal in my computer it works fine (answer 500 000 000 000 000).
Could you help?
My submission 113388721
Codeforces is a 32-bit environment. Dumping the PHP_INT_MAX constant:
in CF yields
int(2147483647)
. I'm guessing that your computer is 64-bit and the code dumps something bigger.When you read the huge integer and try to do math, it gets cast into a float instead of int because it is bigger than the maximum allowed integer.
This will give
float(1.0E+15)
if I write1000000000000000
as the input butint(100)
if i write100
as the input. Welcome to PHP.