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 10, 2021 19:27Sergey StreminSergey StreminScore: 491,660Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 10, 2021 19:25421,0712,119,284,7212,063,247,88802,203,648
2May 10, 2021 19:25421,1952,124,499,1072,063,853,98302,203,648
3May 10, 2021 19:27421,3812,126,063,5972,064,767,87102,207,744
4May 10, 2021 19:25421,3832,136,062,5552,064,776,57102,207,744
5May 10, 2021 19:27421,4052,127,326,9362,064,884,55002,199,552
6May 10, 2021 19:27421,4762,137,488,3592,065,233,15202,199,552
7May 10, 2021 19:27491,6602,489,942,5782,409,134,46902,211,840
8May 10, 2021 19:25491,7532,465,577,4652,409,587,87702,199,552
9May 10, 2021 19:27491,7602,463,407,4482,409,625,84002,203,648
10May 10, 2021 19:25491,7652,467,464,0422,409,646,08902,207,744
11May 10, 2021 19:25491,9492,481,229,7172,410,551,77702,203,648
12May 10, 2021 19:27492,1292,473,410,7342,411,432,22702,199,552