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 17, 2021 23:54Yurkov AlekseyYurkov AlekseyScore: 671,513Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 17, 2021 23:54638,6273,182,697,4143,129,274,05002,281,472
2May 17, 2021 23:54638,6773,200,586,5633,129,517,54002,281,472
3May 17, 2021 23:54638,6963,185,992,7073,129,607,99702,260,992
4May 17, 2021 23:54671,5133,347,142,6623,290,415,42302,269,184
5May 17, 2021 23:54671,7803,371,681,2433,291,720,89702,265,088
6May 17, 2021 23:54671,8593,363,885,0753,292,110,98102,277,376