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:16Robert BurkeRobert BurkeScore: 55,378Success
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 11:5952,930327,777,728259,357,36802,174,976
2Oct 4, 2022 12:1652,977325,275,228259,588,61902,174,976
3Oct 4, 2022 11:5953,020320,267,563259,795,82402,183,168
4Oct 4, 2022 12:1653,720329,136,301263,228,59502,191,360
5Oct 4, 2022 12:1654,428334,721,655266,697,06002,187,264
6Oct 4, 2022 11:5955,360294,431,083270,266,0001,000,0002,437,120
7Oct 4, 2022 11:5955,370298,514,476270,312,0001,001,0002,441,216
8Oct 4, 2022 11:5955,371289,759,864270,319,0001,001,0002,277,376
9Oct 4, 2022 12:1655,372292,082,281269,328,0001,995,0002,281,472
10Oct 4, 2022 12:1655,375293,703,385270,335,0001,001,0002,449,408
11Oct 4, 2022 12:1655,375295,897,143270,337,0001,001,0002,281,472
12Oct 4, 2022 11:5955,376292,820,392270,342,0001,001,0002,453,504
13Oct 4, 2022 11:5955,378300,356,387270,353,0001,001,0002,281,472
14Oct 4, 2022 11:5955,384294,706,528269,386,0001,995,0002,281,472
15Oct 4, 2022 11:5955,391295,201,586270,415,0001,001,0002,531,328
16Oct 4, 2022 11:5955,405296,340,634270,483,0001,001,0002,281,472
17Oct 4, 2022 12:1655,416292,981,526269,541,0001,996,0002,281,472
18Oct 4, 2022 12:1655,437293,716,603270,643,000998,0002,281,472
19Oct 4, 2022 12:1655,487296,078,269269,885,0001,999,0002,281,472
20Oct 4, 2022 11:5955,676297,449,821270,814,0001,998,0002,281,472
21Oct 4, 2022 11:5955,691325,765,044272,885,13102,183,168
22Oct 4, 2022 12:1655,844298,729,823271,637,0001,997,0002,281,472
23Oct 4, 2022 12:1655,899295,117,477271,905,0001,999,0002,453,504
24Oct 4, 2022 12:1655,964296,938,727273,224,0001,000,0002,281,472