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 listMay 22, 2021 15:33Dmitry DolgopolovDmitry DolgopolovScore: 476,776Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 22, 2021 15:33434,0852,204,022,9362,127,016,36902,256,896
2May 22, 2021 15:33434,1152,205,935,3402,127,165,34102,244,608
3May 22, 2021 15:33434,1852,190,211,1512,127,507,47602,252,800
4May 22, 2021 15:33476,7762,406,106,0002,336,200,19502,252,800
5May 22, 2021 15:33476,7762,404,811,8662,336,202,44902,252,800
6May 22, 2021 15:33476,8182,405,222,2892,336,409,51402,260,992