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 09:52Sergey StreminSergey StreminScore: 513,834Success
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 09:52440,6042,229,268,5392,158,959,62502,211,840
2May 7, 2021 09:52441,9362,239,048,1212,165,484,70902,203,648
3May 7, 2021 09:52441,9832,228,132,3532,165,716,98102,191,360
4May 20, 2021 11:21442,6352,238,306,6582,168,913,71702,203,648
5May 20, 2021 11:21442,6462,224,773,8822,168,964,24302,199,552
6May 7, 2021 09:52442,6922,237,993,5982,169,189,90202,211,840
7May 7, 2021 09:52443,2182,234,008,6712,171,766,37202,215,936
8May 7, 2021 09:52443,2992,237,439,1322,172,163,64402,203,648
9May 20, 2021 11:21443,9992,238,162,3142,175,593,10402,203,648
10May 20, 2021 11:21513,8342,584,444,0772,517,785,44502,203,648
11May 20, 2021 11:21513,9062,586,115,6992,518,139,65302,207,744
12May 7, 2021 09:52514,8412,580,223,9962,522,719,14102,191,360
13May 7, 2021 09:52514,9322,588,159,9272,523,164,92802,203,648
14May 7, 2021 09:52514,9472,590,991,4912,523,240,07702,215,936
15May 7, 2021 09:52515,1752,593,844,3842,524,355,12702,211,840
16May 7, 2021 09:52515,4112,589,969,5322,525,512,65302,207,744
17May 7, 2021 09:52515,4962,584,386,7502,525,932,44102,203,648
18May 20, 2021 11:21516,1832,593,225,7052,529,298,37302,203,648