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 listOct 25, 2021 08:03Ilya AniskovetsIlya AniskovetsScore: 226,936Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 25, 2021 08:11226,3661,170,635,0321,109,195,29402,260,992
2Sep 2, 2021 16:32226,3691,166,449,7641,109,206,20702,281,472
3Oct 25, 2021 08:11226,7871,182,982,5291,111,256,60902,248,704
4Oct 25, 2021 08:11226,7971,181,812,1961,111,305,66002,260,992
5Oct 25, 2021 08:03226,9361,173,169,5681,111,988,19602,277,376
6Sep 2, 2021 16:32226,9561,178,902,8711,112,083,79302,269,184
7Oct 25, 2021 08:03227,0131,185,377,0941,112,362,77102,277,376
8Oct 25, 2021 08:03227,2751,178,508,5591,113,648,71402,269,184
9Sep 2, 2021 16:32231,4101,190,161,6581,133,909,06902,260,992