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 24, 2021 16:12Yuriy LyfenkoYuriy LyfenkoScore: 183,701Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 16:11177,671936,537,670870,587,34902,236,416
2May 24, 2021 16:11180,802948,183,240885,931,11302,236,416
3May 24, 2021 16:12182,032957,471,528891,958,47002,310,144
4May 24, 2021 16:12183,701962,162,557900,136,07502,297,856
5May 24, 2021 16:12188,193985,773,164922,146,91602,301,952
6May 24, 2021 16:11189,661995,179,707929,341,14502,228,224