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:35Yuriy LyfenkoYuriy LyfenkoScore: 100,288Success
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:3599,506566,385,393487,581,14202,199,552
2Dec 9, 2021 07:3599,874546,599,180489,381,09502,195,456
3Dec 9, 2021 07:35100,174519,021,529489,852,000999,0002,461,696
4Dec 9, 2021 07:35100,191517,295,245488,935,0001,999,0002,265,088
5Dec 9, 2021 07:35100,256519,190,692490,254,0001,000,0002,265,088
6Dec 9, 2021 07:35100,260521,600,642491,275,00002,527,232
7Dec 9, 2021 07:35100,288521,877,180490,413,0001,000,0002,342,912
8Dec 9, 2021 07:35100,310520,209,413489,521,0001,998,0002,265,088
9Dec 9, 2021 07:35100,323525,615,704489,585,0001,998,0002,326,528
10Dec 9, 2021 07:35100,328560,196,414491,606,54402,207,744
11Dec 9, 2021 07:35100,330516,561,653490,616,000999,0002,338,816
12Dec 9, 2021 07:35100,333517,374,628490,635,000999,0002,527,232