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 listNov 10, 2024 08:12E SequeiraE SequeiraScore: 766,368Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 10, 2024 08:12766,2183,786,901,9663,751,470,0002,997,0002,293,760
2Nov 10, 2024 08:12766,2253,779,989,2363,752,505,0001,998,0002,293,760
3Nov 10, 2024 08:12766,3333,784,004,7083,752,033,0002,997,0002,285,568
4Nov 10, 2024 08:12766,3603,788,682,4383,753,166,0001,999,0002,269,184
5Nov 10, 2024 08:12766,3683,786,426,9743,752,205,0002,998,0002,293,760
6Nov 10, 2024 08:12766,4023,786,787,4913,753,373,0001,998,0002,285,568
7Nov 10, 2024 08:12766,4183,789,409,7523,753,452,0001,998,0002,297,856
8Nov 10, 2024 08:12766,4573,783,079,9753,753,643,0001,998,0002,281,472
9Nov 10, 2024 08:12766,5133,783,164,0413,753,918,0001,998,0002,379,776