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 3, 2024 18:17Hal FHal FScore: 79,517Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2024 18:1779,384413,358,607385,981,0002,999,0002,281,472
2May 3, 2024 18:1779,400415,767,374386,062,0003,000,0002,289,664
3May 3, 2024 18:1779,434418,786,757386,228,0003,001,0002,289,664
4May 3, 2024 18:1779,484415,703,001388,474,000998,0002,527,232
5May 3, 2024 18:1779,515417,398,508386,628,0002,997,0002,289,664
6May 3, 2024 18:1779,517417,090,066386,635,0002,997,0002,289,664
7May 3, 2024 18:1779,517418,369,231386,636,0002,997,0002,281,472
8May 3, 2024 18:1779,518421,112,904387,642,0001,998,0002,289,664
9May 3, 2024 18:1779,580417,123,369386,942,0002,999,0002,281,472
10May 3, 2024 18:1783,095564,562,370407,163,262020,758,528
11May 3, 2024 18:1783,409586,690,179408,705,198020,897,792
12May 3, 2024 18:1783,820570,841,628410,718,639020,643,840