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 listOct 2, 2022 04:29Bernard TeoBernard TeoScore: 71,203Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 2, 2022 04:2968,549412,818,456335,889,81902,269,184
2Oct 2, 2022 04:2968,587401,389,972336,077,70602,269,184
3Oct 2, 2022 04:2971,171372,132,464346,738,0001,998,0002,404,352
4Oct 2, 2022 04:2971,180375,776,656346,786,0001,998,0002,281,472
5Oct 2, 2022 04:2971,185370,605,265346,807,0001,998,0002,404,352
6Oct 2, 2022 04:2971,189375,836,958346,829,0001,999,0002,400,256
7Oct 2, 2022 04:2971,203373,725,061346,896,0001,999,0002,281,472
8Oct 2, 2022 04:2971,209371,366,770346,926,0001,999,0002,392,064
9Oct 2, 2022 04:2971,213376,841,619346,943,0001,999,0002,396,160
10Oct 2, 2022 04:2971,232373,295,397347,035,0002,000,0002,396,160
11Oct 2, 2022 04:2971,232372,247,530348,037,0001,000,0002,392,064
12Oct 2, 2022 04:2973,020429,878,985357,799,61102,252,800