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 17:15Robert BurkeRobert BurkeScore: 81,108Success
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 17:1580,410442,540,726394,006,75902,293,760
2Jul 21, 2022 17:1580,416446,144,205394,037,24302,281,472
3Jul 21, 2022 17:1580,454467,878,376394,226,73302,289,664
4Jul 21, 2022 17:1580,996418,730,113395,882,000999,0002,428,928
5Jul 21, 2022 17:1581,033423,399,692396,062,0001,000,0002,281,472
6Jul 21, 2022 17:1581,102419,935,415396,400,000998,0002,281,472
7Jul 21, 2022 17:1581,108421,509,161396,432,000998,0002,428,928
8Jul 21, 2022 17:1581,111426,690,658397,445,00002,281,472
9Jul 21, 2022 17:1581,122424,747,068397,497,00002,281,472
10Jul 21, 2022 17:1581,143424,534,501397,602,00002,281,472
11Jul 21, 2022 17:1581,170421,550,334395,736,0001,998,0002,281,472
12Jul 21, 2022 17:1581,222420,234,972396,987,000999,0002,281,472