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 4, 2022 12:23Robert BurkeRobert BurkeScore: 68,193Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 12:2362,285356,612,431305,197,80402,187,264
2Oct 4, 2022 12:2362,293372,145,271305,237,46302,183,168
3Oct 4, 2022 12:2362,793379,995,943307,686,43502,183,168
4Oct 4, 2022 12:2368,103363,292,090331,705,0001,998,0002,281,472
5Oct 4, 2022 12:2368,174356,782,823332,055,0002,000,0002,441,216
6Oct 4, 2022 12:2368,180355,986,332332,084,0002,000,0002,281,472
7Oct 4, 2022 12:2368,193352,801,952333,146,0001,000,0002,449,408
8Oct 4, 2022 12:2368,203362,254,936333,193,0001,000,0002,281,472
9Oct 4, 2022 12:2368,220360,545,646333,276,0001,000,0002,445,312
10Oct 4, 2022 12:2368,237363,042,440333,362,0001,001,0002,281,472
11Oct 4, 2022 12:2368,901366,173,244335,616,0001,997,0002,441,216
12Oct 4, 2022 12:2368,977361,123,552336,990,000999,0002,445,312