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 3, 2021 21:33Dmitry DolgopolovDmitry DolgopolovScore: 501,121Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2021 21:33455,3112,308,050,5582,231,023,71602,256,896
2May 3, 2021 21:33455,3452,286,746,7282,231,189,94502,256,896
3May 3, 2021 21:33455,4002,292,065,5852,231,459,91302,252,800
4May 3, 2021 21:33501,1212,521,914,8482,455,494,73902,256,896
5May 3, 2021 21:33501,8592,524,475,7782,459,106,93302,260,992
6May 3, 2021 21:33502,0472,521,212,1942,460,030,81502,248,704