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 23:09Robert BurkeRobert BurkeScore: 73,590Success
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 23:0970,603410,044,302345,956,48802,273,280
2Jul 21, 2022 23:0970,671406,818,376346,290,23102,285,568
3Jul 21, 2022 23:0970,883406,507,676347,327,27302,285,568
4Jul 21, 2022 23:0973,580387,631,692358,546,0001,997,0002,281,472
5Jul 21, 2022 23:0973,582382,559,915359,552,000998,0002,424,832
6Jul 21, 2022 23:0973,587382,232,358359,580,000998,0002,281,472
7Jul 21, 2022 23:0973,590388,250,094359,594,000998,0002,281,472
8Jul 21, 2022 23:0973,600389,320,081360,640,00002,281,472
9Jul 21, 2022 23:0973,608384,546,653358,682,0001,998,0002,281,472
10Jul 21, 2022 23:0973,612385,055,087359,699,000999,0002,514,944
11Jul 21, 2022 23:0973,624377,990,339359,757,000999,0002,428,928
12Jul 21, 2022 23:0973,628381,239,560359,780,000999,0002,428,928