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 11:54Robert BurkeRobert BurkeScore: 102,033Success
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 11:5498,395565,922,164482,136,99302,293,760
2Jul 20, 2022 11:5498,436552,574,712482,334,87602,297,856
3Jul 20, 2022 11:5498,447541,441,719482,388,90102,285,568
4Jul 20, 2022 11:5498,447541,823,547482,388,63002,289,664
5Jul 20, 2022 11:5498,497562,370,109482,633,19602,285,568
6Jul 20, 2022 11:5498,523544,968,822482,764,67802,285,568
7Jul 20, 2022 11:54101,917525,032,251499,393,00002,277,376
8Jul 20, 2022 11:54101,924529,166,436499,427,00002,424,832
9Jul 20, 2022 11:54101,959529,397,799499,597,00002,281,472
10Jul 20, 2022 11:54101,962520,166,272498,617,000999,0002,433,024
11Jul 20, 2022 11:54101,964520,911,394497,628,0001,998,0002,428,928
12Jul 20, 2022 11:54102,024522,797,132498,921,000999,0002,273,280
13Jul 20, 2022 11:54102,033526,532,025498,961,000999,0002,281,472
14Jul 20, 2022 11:54102,037523,770,793497,982,0001,999,0002,281,472
15Jul 20, 2022 11:54102,039527,102,876498,994,000999,0002,433,024
16Jul 20, 2022 11:54102,041520,237,801498,001,0002,000,0002,281,472
17Jul 20, 2022 11:54102,053520,754,398499,060,0001,000,0002,277,376
18Jul 20, 2022 11:54102,062524,944,050499,108,000998,0002,514,944
19Jul 20, 2022 11:54102,068522,198,289500,133,00002,428,928
20Jul 20, 2022 11:54102,079523,732,075500,186,00002,281,472
21Jul 20, 2022 11:54102,079527,123,535499,185,0001,000,0002,428,928
22Jul 20, 2022 11:54102,081522,859,040500,196,00002,428,928
23Jul 20, 2022 11:54102,085520,824,571500,216,00002,277,376
24Jul 20, 2022 11:54102,109528,205,611499,334,000998,0002,428,928