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 19, 2021 21:34Yuriy LyfenkoYuriy LyfenkoScore: 732,071Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 21:34684,1403,412,103,3423,352,287,71702,256,896
2May 19, 2021 21:34684,1463,430,510,7553,352,313,90202,252,800
3May 19, 2021 21:34684,1903,428,237,1543,352,532,62802,256,896
4May 19, 2021 21:34732,0333,651,845,3663,586,959,66502,252,800
5May 19, 2021 21:34732,0713,651,819,4343,587,145,97502,260,992
6May 19, 2021 21:34732,0713,648,542,4053,587,145,78702,248,704
7May 19, 2021 21:34732,2673,657,622,5023,588,109,05502,252,800
8May 19, 2021 21:34732,2833,654,093,3453,588,187,75302,252,800
9May 19, 2021 21:34732,5283,660,005,6313,589,389,08002,260,992