Long Long Integer / Long Integer // depends
First we need to calculate the binary representation of Given Integer
We can do that easily by continuous Mod (%) and Divide (/) operation.
(see Project Euler: 4 >>> Filed under: Euler 1 to 10)
In C/C++, we can use function itoa under <stdlib.h>, but perhaps uva online judge don’t support this function, so it’s a better idea to convert it manually. Output should be exactly the same as given.
The parity of 1111111111111111111111111111111 is 31 (mod 2).
The parity of 11101110011010110010100000000 is 13 (mod 2).
The parity of 111011100110101100100111111111 is 21 (mod 2).