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 30, 2022 11:42Robert BurkeRobert BurkeScore: 61,711Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 11:4259,431359,659,979291,210,40302,179,072
2Jul 30, 2022 11:4259,488352,561,626291,488,79402,179,072
3Jul 30, 2022 11:4261,618322,571,166299,930,0001,999,0002,445,312
4Jul 30, 2022 11:4261,642319,355,357300,046,0002,000,0002,437,120
5Jul 30, 2022 11:4261,666328,192,087301,162,0001,000,0002,445,312
6Jul 30, 2022 11:4261,678321,875,091301,223,0001,000,0002,531,328
7Jul 30, 2022 11:4261,711326,052,134300,391,0001,995,0002,445,312
8Jul 30, 2022 11:4261,713328,889,428301,394,0001,001,0002,441,216
9Jul 30, 2022 11:4261,715325,832,575301,403,0001,001,0002,535,424
10Jul 30, 2022 11:4261,931368,081,904303,460,96002,256,896
11Jul 30, 2022 11:4261,987325,811,598301,739,0001,998,0002,441,216
12Jul 30, 2022 11:4262,019324,400,584301,893,0001,999,0002,281,472