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:38Sergey StreminSergey StreminScore: 625,608Success
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:38574,6622,882,327,8062,815,843,90602,199,552
2May 7, 2021 09:39574,7612,881,013,4282,816,326,53602,203,648
3May 7, 2021 09:39574,8092,885,817,1872,816,563,46902,207,744
4May 7, 2021 09:38574,8532,875,799,4932,816,781,91502,211,840
5May 7, 2021 09:39574,9322,884,205,0272,817,168,25102,195,456
6May 7, 2021 09:38575,0122,893,635,9562,817,558,97402,199,552
7May 7, 2021 09:38625,6083,134,989,9353,065,479,32402,207,744
8May 7, 2021 09:39625,6563,132,608,6993,065,713,94502,203,648
9May 7, 2021 09:38625,6793,130,256,0623,065,828,78802,203,648
10May 7, 2021 09:39625,9653,118,811,6843,067,228,06402,207,744
11May 7, 2021 09:38626,0893,137,141,6783,067,838,11202,211,840
12May 7, 2021 09:39626,4643,126,716,5663,069,674,03502,195,456