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:25Bernard TeoBernard TeoScore: 54,443Success
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:2554,380292,936,483266,462,00002,396,160
2Nov 2, 2022 00:2554,401291,634,039265,569,000998,0002,281,472
3Nov 2, 2022 00:2554,418298,271,405264,651,0001,997,0002,281,472
4Nov 2, 2022 00:2554,422288,605,449264,673,0001,997,0002,510,848
5Nov 2, 2022 00:2554,440295,135,769265,756,000999,0002,281,472
6Nov 2, 2022 00:2554,441291,622,655265,764,000999,0002,281,472
7Nov 2, 2022 00:2554,443293,476,478264,772,0001,998,0002,281,472
8Nov 2, 2022 00:2554,475291,058,868265,927,000999,0002,510,848
9Nov 2, 2022 00:2554,481290,721,636266,958,00002,396,160
10Nov 2, 2022 00:2556,990343,882,420279,251,57802,269,184
11Nov 2, 2022 00:2559,113357,952,576289,652,36002,256,896
12Nov 2, 2022 00:2559,305362,013,834290,595,00702,252,800