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:32Yuriy LyfenkoYuriy LyfenkoScore: 724,979Success
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:32654,3403,272,428,6433,206,265,37402,260,992
2May 19, 2021 21:32654,4093,274,538,3413,206,605,11102,252,800
3May 19, 2021 21:32654,4743,285,275,7263,206,920,62002,244,608
4May 19, 2021 21:32724,9663,611,090,5873,552,334,43202,269,184
5May 19, 2021 21:32724,9793,613,122,5583,552,394,85702,244,608
6May 19, 2021 21:32725,1163,622,130,1933,553,067,86802,256,896
7May 19, 2021 21:32725,2143,612,004,1293,553,550,87202,260,992
8May 19, 2021 21:32725,3353,622,608,4293,554,141,82102,256,896
9May 19, 2021 21:32725,4473,629,237,9043,554,692,04602,252,800