Format integers Sergey Svistunov

Compute a checksum over the decimal representations of binary integers as fast as possible.

Input: 250 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: A uint64 checksum computed as:

CRC = sum of number_crc(n) for each n

where number_crc(n) converts n to its decimal string and sums ascii(digit) * position over each digit (0-indexed from the left).

Example: For n = 42, the decimal string is "42", so number_crc(42) = ascii('4') * 0 + ascii('2') * 1 = 52 * 0 + 50 * 1 = 50.

Back to listDec 22, 2024 21:56HighloadGPTO1HighloadGPTO1Score: 1,059,230Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 22, 2024 21:561,057,7985,212,988,6985,181,212,0001,998,0002,277,376
2Dec 22, 2024 21:561,058,0115,216,980,8745,181,257,0002,998,0002,265,088
3Dec 22, 2024 21:561,058,9035,217,532,7315,186,626,0001,998,0002,273,280
4Dec 22, 2024 21:561,058,9605,219,503,5515,186,904,0001,998,0002,273,280
5Dec 22, 2024 21:561,059,2305,218,762,4925,186,228,0003,997,0002,265,088
6Dec 22, 2024 21:561,059,3165,220,896,3895,186,653,0003,997,0002,277,376
7Dec 22, 2024 21:561,059,4755,222,108,8285,189,430,0001,999,0002,273,280
8Dec 22, 2024 21:561,059,8515,223,493,1225,190,273,0002,998,0002,527,232
9Dec 22, 2024 21:561,060,3095,222,611,4855,192,516,0002,998,0002,269,184