Times in seconds n C C++ C++ long long Java Python, range Python, while 10^7 0.001* 0.001* 0.003 0.006 1.53 2.67 10^9 0.10** 0.10** 0.30 0.40 145 345 Wrong output: * -2004260032 instead of 50000005000000 ** -243309312 instead of 500000000500000000 Bit 6666666666555555555544444444443333333333222222222211111111110000000000 position 9876543210987654321098765432109876543210987654321098765432109876543210 >>> bin(10**9) '0b111011100110101100101000000000' >>> bin(50000005000000) '0b1011010111100110001000100010010110101101000000' >>> bin(-2004260032+2^32) '0b10001000100010010110101101000000' >>> bin(500000000500000000) '0b11011110000010110110101100111110001011111110110010100000000' >>> bin(-243309312+2^32) '0b11110001011111110110010100000000'