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 listOct 28, 2021 16:22evgenikwtevgenikwtScore: 176,527Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 28, 2021 16:10173,583904,840,462850,556,04202,207,744
2Nov 1, 2021 22:15174,256905,675,200853,856,00502,203,648
3Nov 1, 2021 22:15174,634922,653,573855,707,88302,207,744
4Oct 28, 2021 16:10174,790925,046,160856,473,05102,211,840
5Oct 28, 2021 16:24175,473920,706,544859,815,58502,199,552
6Oct 28, 2021 16:24176,181932,398,727863,285,53202,207,744
7Oct 28, 2021 16:22176,527925,723,090864,983,04102,207,744
8Nov 1, 2021 22:15176,612923,837,809865,400,29902,207,744
9Oct 28, 2021 16:10176,618920,811,717865,430,44302,236,416
10Oct 28, 2021 16:24177,539925,184,353869,939,09302,207,744
11Oct 28, 2021 16:22178,848946,580,968876,354,81402,199,552
12Oct 28, 2021 16:22178,976939,828,495876,983,91402,207,744