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 listApr 27, 2024 12:49Hal FHal FScore: 58,439Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 12:4954,148333,237,337265,323,06002,277,376
2Apr 27, 2024 12:4954,208339,456,851265,620,63902,273,280
3Apr 27, 2024 12:4954,253321,928,443265,840,07602,277,376
4Apr 27, 2024 12:4958,339306,562,640282,861,0002,998,0002,375,680
5Apr 27, 2024 12:4958,371315,742,561284,018,0002,000,0002,289,664
6Apr 27, 2024 12:4958,408308,649,144284,196,0002,001,0002,289,664
7Apr 27, 2024 12:4958,439309,524,892284,347,0002,002,0002,527,232
8Apr 27, 2024 12:4959,122318,217,794287,699,0001,997,0002,510,848
9Apr 27, 2024 12:4959,146309,947,698287,817,0001,998,0002,265,088
10Apr 27, 2024 12:4959,150317,358,627287,839,0001,998,0002,269,184
11Apr 27, 2024 12:4962,210328,020,927301,829,0002,998,0002,289,664
12Apr 27, 2024 12:4963,761344,415,160311,429,0001,001,0002,265,088