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 2, 2022 00:30Bernard TeoBernard TeoScore: 49,007Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 2, 2022 00:3048,897267,795,106238,599,000998,0002,281,472
2Nov 2, 2022 00:3048,911265,747,728237,668,0001,997,0002,404,352
3Nov 2, 2022 00:3048,913266,861,144237,679,0001,997,0002,396,160
4Nov 2, 2022 00:3048,928263,607,934238,749,000998,0002,281,472
5Nov 2, 2022 00:3048,944263,103,845238,828,000999,0002,281,472
6Nov 2, 2022 00:3048,945263,733,032237,833,0001,998,0002,277,376
7Nov 2, 2022 00:3049,007267,683,112240,133,00002,281,472
8Nov 2, 2022 00:3049,050264,063,513239,343,0001,001,0002,400,256
9Nov 2, 2022 00:3049,101265,159,304239,596,000998,0002,510,848
10Nov 2, 2022 00:3049,331307,001,831241,722,32502,269,184
11Nov 2, 2022 00:3049,343296,792,699241,780,45302,256,896
12Nov 2, 2022 00:3051,249319,592,789251,119,68902,269,184