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 20, 2021 05:29Yuriy LyfenkoYuriy LyfenkoScore: 118,426Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 05:31113,017612,320,573553,784,89702,187,264
2May 20, 2021 05:31115,997625,672,320568,387,00602,179,072
3May 20, 2021 05:31116,148641,373,593569,124,04702,301,952
4May 20, 2021 05:31116,568656,342,268571,182,73902,179,072
5May 20, 2021 05:29118,140650,155,808578,888,27702,183,168
6May 20, 2021 05:31118,356638,602,500579,945,09602,179,072
7May 20, 2021 05:29118,426636,812,756580,287,37602,191,360
8May 20, 2021 05:31119,444640,631,088585,275,90702,297,856
9May 20, 2021 05:31120,788655,512,807591,861,13202,179,072
10May 20, 2021 05:31120,931662,489,329592,563,38102,306,048
11May 20, 2021 05:29123,868675,527,795606,951,21902,179,072
12May 20, 2021 05:31129,552703,353,136634,804,39202,293,760