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 20, 2022 15:32Robert BurkeRobert BurkeScore: 99,400Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 15:3288,886490,978,713435,539,62402,293,760
2Jul 20, 2022 15:3288,941518,667,333435,809,44802,297,856
3Jul 20, 2022 15:3289,056498,421,730436,372,85702,293,760
4Jul 20, 2022 15:3299,345504,999,486485,793,000999,0002,281,472
5Jul 20, 2022 15:3299,371511,536,925485,921,000999,0002,277,376
6Jul 20, 2022 15:3299,373507,809,178484,927,0001,999,0002,519,040
7Jul 20, 2022 15:3299,400512,576,143486,062,000998,0002,428,928
8Jul 20, 2022 15:3299,412512,876,961486,121,0001,000,0002,433,024
9Jul 20, 2022 15:3299,417515,560,276487,143,00002,277,376
10Jul 20, 2022 15:3299,419509,628,320487,154,00002,433,024
11Jul 20, 2022 15:3299,422512,679,731486,169,0001,000,0002,281,472
12Jul 20, 2022 15:3299,433512,162,559486,224,0001,000,0002,420,736