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 listJul 22, 2022 03:12Robert BurkeRobert BurkeScore: 64,693Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 22, 2022 03:1063,752375,107,274312,384,38702,285,568
2Jul 22, 2022 03:1263,849372,759,054312,858,46802,285,568
3Jul 22, 2022 03:1263,895370,215,939313,086,66602,285,568
4Jul 22, 2022 03:1063,933367,803,101313,273,55602,277,376
5Jul 22, 2022 03:1064,650340,022,761315,787,000999,0002,428,928
6Jul 22, 2022 03:1064,653337,997,632315,801,000999,0002,281,472
7Jul 22, 2022 03:1064,659342,547,544315,829,000999,0002,281,472
8Jul 22, 2022 03:1264,661340,227,553316,839,00002,428,928
9Jul 22, 2022 03:1064,673342,096,906314,901,0001,999,0002,420,736
10Jul 22, 2022 03:1264,677339,652,048316,919,00002,281,472
11Jul 22, 2022 03:1264,687342,198,293314,965,0001,999,0002,281,472
12Jul 22, 2022 03:1064,692336,212,378315,990,000999,0002,281,472
13Jul 22, 2022 03:1264,693343,561,341314,996,0001,999,0002,424,832
14Jul 22, 2022 03:1064,694338,878,364315,000,0002,000,0002,428,928
15Jul 22, 2022 03:1064,696339,096,270317,008,00002,523,136
16Jul 22, 2022 03:1264,709340,268,951316,076,0001,000,0002,281,472
17Jul 22, 2022 03:1064,725338,886,171315,154,0002,000,0002,433,024
18Jul 22, 2022 03:1264,736346,287,783317,206,00002,433,024
19Jul 22, 2022 03:1264,779350,028,887317,417,00002,281,472
20Jul 22, 2022 03:1065,234341,502,356318,647,000998,0002,428,928
21Jul 22, 2022 03:1265,271342,965,955317,832,0001,998,0002,424,832
22Jul 22, 2022 03:1265,277342,256,002318,859,000999,0002,281,472
23Jul 22, 2022 03:1266,557394,160,553326,129,86902,293,760
24Jul 22, 2022 03:1066,760393,277,772327,125,50002,289,664