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 22, 2022 00:43Robert BurkeRobert BurkeScore: 70,233Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 22, 2022 00:4367,761394,510,555332,029,50702,289,664
2Jul 22, 2022 00:4367,813384,112,961332,281,27302,252,800
3Jul 22, 2022 00:4367,868408,411,561332,554,05002,285,568
4Jul 22, 2022 00:4370,197366,916,274341,968,0001,999,0002,281,472
5Jul 22, 2022 00:4370,208369,333,785343,017,0001,000,0002,424,832
6Jul 22, 2022 00:4370,225366,219,269343,102,0001,000,0002,433,024
7Jul 22, 2022 00:4370,233369,418,804344,140,00002,428,928
8Jul 22, 2022 00:4370,267371,817,237344,306,00002,281,472
9Jul 22, 2022 00:4370,276368,020,737344,354,00002,510,848
10Jul 22, 2022 00:4370,381363,560,908342,867,0001,999,0002,514,944
11Jul 22, 2022 00:4370,467370,942,620345,290,00002,437,120
12Jul 22, 2022 00:4370,592372,170,494344,903,000999,0002,281,472