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 24, 2024 17:52E SequeiraE SequeiraScore: 765,299Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 24, 2024 17:52765,2613,780,207,8293,746,783,0002,997,0002,523,136
2Nov 24, 2024 17:52765,2653,779,933,4783,747,801,0001,998,0002,285,568
3Nov 24, 2024 17:52765,2683,778,566,9623,747,813,0001,998,0002,281,472
4Nov 24, 2024 17:52765,2973,776,927,9793,746,959,0002,997,0002,289,664
5Nov 24, 2024 17:52765,2993,777,307,4993,747,968,0001,998,0002,289,664
6Nov 24, 2024 17:52765,3033,780,679,8203,746,990,0002,997,0002,281,472
7Nov 24, 2024 17:52765,4083,777,800,4373,747,500,0002,998,0002,281,472
8Nov 24, 2024 17:52766,4643,785,038,2433,752,675,0002,997,0002,289,664
9Nov 24, 2024 17:52766,6033,784,615,9583,753,356,0002,997,0002,269,184