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 listMay 2, 2024 19:58Hal FHal FScore: 71,295Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 2, 2024 19:5866,961394,154,049328,107,93202,281,472
2May 2, 2024 19:5868,227389,248,798334,310,92402,273,280
3May 2, 2024 19:5870,701378,216,697345,433,0001,001,0002,281,472
4May 2, 2024 19:5870,740373,317,273344,630,0001,997,0002,273,280
5May 2, 2024 19:5870,906374,567,117345,439,0002,002,0002,289,664
6May 2, 2024 19:5870,988371,225,147344,845,0002,998,0002,281,472
7May 2, 2024 19:5871,295371,928,215347,344,0002,001,0002,289,664
8May 2, 2024 19:5871,498372,080,841349,339,0001,000,0002,273,280
9May 2, 2024 19:5871,529377,008,580347,496,0002,995,0002,531,328
10May 2, 2024 19:5871,601377,057,369347,849,0002,998,0002,289,664
11May 2, 2024 19:5884,364471,974,265413,381,90702,273,280
12May 2, 2024 19:58109,759570,739,814534,821,0002,998,0002,289,664