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 10:53Robert BurkeRobert BurkeScore: 67,522Success
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 10:5365,160399,005,907319,282,45502,183,168
2Jul 30, 2022 10:5365,217386,386,594319,562,90002,179,072
3Jul 30, 2022 10:5365,237392,677,674319,662,35902,170,880
4Jul 30, 2022 10:5367,502350,894,380328,764,0001,998,0002,441,216
5Jul 30, 2022 10:5367,505350,297,873328,775,0001,998,0002,277,376
6Jul 30, 2022 10:5367,519353,939,802328,845,0001,999,0002,449,408
7Jul 30, 2022 10:5367,522353,979,004328,857,0001,999,0002,281,472
8Jul 30, 2022 10:5367,522353,952,032328,857,0001,999,0002,281,472
9Jul 30, 2022 10:5367,524350,434,870328,867,0001,999,0002,281,472
10Jul 30, 2022 10:5367,534351,299,757328,919,0001,999,0002,445,312
11Jul 30, 2022 10:5367,538352,113,389328,939,0001,999,0002,281,472
12Jul 30, 2022 10:5367,543355,699,356328,961,0001,999,0002,449,408