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 listNov 1, 2022 23:33Bernard TeoBernard TeoScore: 55,224Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 1, 2022 23:3355,142294,462,160270,194,00002,281,472
2Nov 1, 2022 23:3355,144291,503,021268,203,0002,001,0002,408,448
3Nov 1, 2022 23:3355,158295,121,036269,271,0001,001,0002,396,160
4Nov 1, 2022 23:3355,158295,169,445270,276,00002,400,256
5Nov 1, 2022 23:3355,160293,277,125270,286,00002,281,472
6Nov 1, 2022 23:3355,213293,631,433269,548,000998,0002,400,256
7Nov 1, 2022 23:3355,224299,320,097270,596,00002,400,256
8Nov 1, 2022 23:3355,961300,872,252273,210,0001,000,0002,281,472
9Nov 1, 2022 23:3357,964311,001,214282,023,0002,000,0002,273,280
10Nov 1, 2022 23:3358,274337,263,370285,541,21102,273,280
11Nov 1, 2022 23:3358,302348,140,852285,681,62302,273,280
12Nov 1, 2022 23:3359,122358,641,765289,700,00002,260,992