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 listJan 19, 2025 13:07MatthiasMatthiasScore: 665,624Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 19, 2025 13:07665,4973,288,817,1573,257,939,0002,998,0002,523,136
2Jan 19, 2025 13:07665,5473,284,642,7443,258,184,0002,998,0002,277,376
3Jan 19, 2025 13:07665,6113,291,844,0043,258,495,0002,997,0002,277,376
4Jan 19, 2025 13:07665,6133,292,517,8113,258,506,0002,997,0002,281,472
5Jan 19, 2025 13:07665,6243,288,320,8273,258,559,0002,997,0002,281,472
6Jan 19, 2025 13:07665,6513,285,955,5963,258,693,0002,997,0002,281,472
7Jan 19, 2025 13:07665,6673,287,188,9313,259,769,0001,998,0002,523,136
8Jan 19, 2025 13:07665,6683,291,679,8253,258,774,0002,997,0002,281,472
9Jan 19, 2025 13:07665,7233,292,136,5363,258,044,0003,997,0002,277,376