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:27Bernard TeoBernard TeoScore: 71,235Success
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:2768,469405,164,338335,495,94402,265,088
2Oct 2, 2022 04:2768,495402,796,547335,626,96902,260,992
3Oct 2, 2022 04:2771,211374,433,862347,934,000999,0002,404,352
4Oct 2, 2022 04:2771,217370,386,011346,964,0001,999,0002,281,472
5Oct 2, 2022 04:2771,230372,219,148347,028,0002,000,0002,281,472
6Oct 2, 2022 04:2771,231370,784,375347,034,0002,000,0002,404,352
7Oct 2, 2022 04:2771,235370,617,895348,051,0001,000,0002,281,472
8Oct 2, 2022 04:2771,238374,730,036348,068,0001,000,0002,281,472
9Oct 2, 2022 04:2771,249379,706,148348,122,0001,000,0002,392,064
10Oct 2, 2022 04:2771,253376,083,155347,143,0001,995,0002,281,472
11Oct 2, 2022 04:2771,279369,758,918348,265,0001,000,0002,281,472
12Oct 2, 2022 04:2773,082418,116,150358,099,36602,260,992