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 08:57Sergey StreminSergey StreminScore: 783,353Success
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 08:57728,7933,632,702,5283,571,084,72002,207,744
2May 7, 2021 08:57728,7973,641,841,5333,571,105,52802,203,648
3May 7, 2021 08:57728,9423,631,678,0803,571,817,55402,195,456
4May 7, 2021 08:57729,1783,640,750,8723,572,969,79602,187,264
5May 7, 2021 08:57729,1863,645,863,8373,573,010,70602,203,648
6May 7, 2021 08:57729,2053,638,196,1093,573,106,02902,191,360
7May 7, 2021 08:57783,3533,893,887,1983,838,429,49702,207,744
8May 7, 2021 08:57783,4903,896,536,7113,839,103,00602,199,552
9May 7, 2021 08:57783,6613,895,942,7153,839,937,27002,195,456
10May 7, 2021 08:57783,6683,926,588,4953,839,973,72702,187,264
11May 7, 2021 08:57783,8023,926,036,4103,840,629,02802,203,648
12May 7, 2021 08:57783,8293,913,826,9843,840,760,76402,203,648