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 1, 2021 08:59gchebanovgchebanovScore: 188,904Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 08:59151,476802,696,539742,233,83902,265,088
2Jul 1, 2021 08:59151,913815,057,681744,374,97902,256,896
3Jul 1, 2021 08:59153,262834,326,379750,984,11702,256,896
4Jul 1, 2021 08:59188,871954,791,318923,468,0001,998,0002,371,584
5Jul 1, 2021 08:59188,888955,190,338923,550,0001,999,0002,445,312
6Jul 1, 2021 08:59188,904953,528,614924,629,000999,0002,404,352
7Jul 1, 2021 08:59188,904954,065,295924,633,000999,0002,379,776
8Jul 1, 2021 08:59188,977956,654,552925,986,00002,400,256
9Jul 1, 2021 08:59189,023952,587,593925,213,000999,0002,392,064
10Jul 1, 2021 08:59189,369962,622,627925,907,0001,999,0002,400,256
11Jul 1, 2021 08:59189,415957,011,055927,133,000999,0002,400,256
12Jul 1, 2021 08:59189,418958,533,750926,149,0001,998,0002,273,280