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 7, 2021 07:48Sergey StreminSergey StreminScore: 1,024,760Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 7, 2021 07:49955,2384,753,355,2514,680,667,15802,203,648
2May 7, 2021 07:48955,3554,742,722,3884,681,239,93002,195,456
3May 7, 2021 07:49955,5234,746,734,0954,682,061,24802,207,744
4May 7, 2021 07:48955,6284,745,964,5534,682,576,63902,199,552
5May 7, 2021 07:49955,6594,757,180,9384,682,727,58402,199,552
6May 7, 2021 07:48955,6834,746,206,9724,682,845,42002,203,648
7May 7, 2021 07:491,024,7605,079,719,8325,021,325,55402,211,840
8May 7, 2021 07:481,024,8535,084,448,2605,021,777,77602,195,456
9May 7, 2021 07:481,024,9655,086,743,3015,022,327,12402,203,648
10May 7, 2021 07:481,025,1035,080,226,5545,023,006,23602,207,744
11May 7, 2021 07:491,025,1435,097,579,2965,023,201,15702,191,360
12May 7, 2021 07:491,025,4425,075,808,3765,024,664,99402,195,456