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 listJul 21, 2022 04:56Robert BurkeRobert BurkeScore: 81,908Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 04:5678,581462,611,638385,047,01502,285,568
2Jul 21, 2022 04:5678,601440,908,220385,147,18402,293,760
3Jul 21, 2022 04:5681,869433,750,646401,156,00002,424,832
4Jul 21, 2022 04:5681,894432,256,157400,281,0001,000,0002,281,472
5Jul 21, 2022 04:5681,903425,037,383401,326,00002,428,928
6Jul 21, 2022 04:5681,904422,487,232401,329,00002,281,472
7Jul 21, 2022 04:5681,908435,232,157400,350,0001,000,0002,281,472
8Jul 21, 2022 04:5681,914433,519,588401,381,00002,433,024
9Jul 21, 2022 04:5681,915427,424,016400,385,000998,0002,281,472
10Jul 21, 2022 04:5681,927429,042,415401,441,00002,281,472
11Jul 21, 2022 04:5681,933426,647,535400,470,0001,001,0002,281,472
12Jul 21, 2022 04:5682,022456,030,822401,906,10902,289,664