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 13, 2025 07:46Ian MckibbenIan MckibbenScore: 1,402,300Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 13, 2025 07:471,400,4586,892,837,8386,859,244,0002,998,0002,289,664
2Jan 13, 2025 07:471,400,9796,896,284,1266,862,798,0001,998,0002,281,472
3Jan 13, 2025 07:471,401,2556,896,746,6476,864,153,0001,998,0002,281,472
4Jan 13, 2025 07:471,401,5986,896,584,4476,864,830,0002,998,0002,289,664
5Jan 13, 2025 07:471,401,9636,900,495,0446,865,619,0003,998,0002,281,472
6Jan 13, 2025 07:471,402,2106,904,460,9806,867,829,0002,998,0002,281,472
7Jan 13, 2025 07:471,402,3006,901,213,4926,868,271,0002,998,0002,289,664
8Jan 13, 2025 07:471,402,3776,902,156,5666,866,651,0004,997,0002,281,472
9Jan 13, 2025 07:471,410,0906,944,966,6176,907,442,0001,998,0002,277,376
10Jan 13, 2025 07:461,442,8717,095,363,0757,068,070,0001,998,0002,523,136
11Jan 13, 2025 07:461,443,0377,098,285,2627,068,883,0001,998,0002,281,472
12Jan 13, 2025 07:461,445,7357,119,025,5077,081,102,0002,998,0002,281,472