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 listDec 9, 2021 07:48Yuriy LyfenkoYuriy LyfenkoScore: 100,234Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:4899,780558,631,522488,921,12602,207,744
2Dec 9, 2021 07:4899,871542,910,705489,366,03202,203,648
3Dec 9, 2021 07:48100,124523,150,370488,612,0001,998,0002,265,088
4Dec 9, 2021 07:48100,138516,359,847489,677,000999,0002,527,232
5Dec 9, 2021 07:48100,185513,135,817489,908,000999,0002,338,816
6Dec 9, 2021 07:48100,233513,489,725490,140,0001,000,0002,265,088
7Dec 9, 2021 07:48100,234514,654,038491,148,00002,465,792
8Dec 9, 2021 07:48100,240513,811,915491,178,00002,473,984
9Dec 9, 2021 07:48100,267522,077,242491,307,00002,334,720
10Dec 9, 2021 07:48100,287517,745,788491,408,00002,347,008
11Dec 9, 2021 07:48100,291523,400,763489,431,0001,997,0002,265,088
12Dec 9, 2021 07:48100,363563,369,355491,778,91702,203,648