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 21, 2022 23:11Robert BurkeRobert BurkeScore: 73,678Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 23:1370,303417,552,660344,486,06202,289,664
2Jul 21, 2022 23:1070,306402,749,676344,499,47702,289,664
3Jul 21, 2022 23:1070,328414,897,631344,605,84202,289,664
4Jul 21, 2022 23:1170,335408,571,550344,641,97202,293,760
5Jul 21, 2022 23:1370,340405,002,054344,668,03902,293,760
6Jul 21, 2022 23:1170,342405,490,202344,677,57802,285,568
7Jul 21, 2022 23:1370,367396,104,370344,797,07702,293,760
8Jul 21, 2022 23:1170,734400,867,333346,597,29002,297,856
9Jul 21, 2022 23:1070,976406,298,104347,782,22402,289,664
10Jul 21, 2022 23:1373,651379,086,557359,892,000999,0002,281,472
11Jul 21, 2022 23:1073,657387,383,638359,921,000999,0002,424,832
12Jul 21, 2022 23:1073,661388,386,020359,940,000999,0002,428,928
13Jul 21, 2022 23:1373,662381,142,077357,946,0002,999,0002,281,472
14Jul 21, 2022 23:1373,664383,885,916359,955,000999,0002,281,472
15Jul 21, 2022 23:1073,666384,406,687360,965,00002,281,472
16Jul 21, 2022 23:1373,670384,064,384360,982,00002,281,472
17Jul 21, 2022 23:1173,673381,878,398360,000,0001,000,0002,433,024
18Jul 21, 2022 23:1073,675382,687,978359,007,0002,000,0002,428,928
19Jul 21, 2022 23:1373,678380,013,307361,022,00002,424,832
20Jul 21, 2022 23:1073,678382,289,562360,021,0001,000,0002,428,928
21Jul 21, 2022 23:1173,686382,634,839360,063,0001,000,0002,514,944
22Jul 21, 2022 23:1173,687384,835,337361,068,00002,281,472
23Jul 21, 2022 23:1073,699384,086,754361,124,00002,428,928
24Jul 21, 2022 23:1173,704388,238,187361,151,00002,281,472
25Jul 21, 2022 23:1173,709384,127,800360,172,0001,000,0002,281,472
26Jul 21, 2022 23:1173,712383,813,326359,190,0002,001,0002,281,472
27Jul 21, 2022 23:1073,750386,851,886359,379,0001,996,0002,424,832
28Jul 21, 2022 23:1173,762387,687,496361,434,00002,281,472
29Jul 21, 2022 23:1373,763387,595,600361,437,00002,281,472
30Jul 21, 2022 23:1373,789390,776,505360,566,000998,0002,428,928
31Jul 21, 2022 23:1173,794389,629,147360,593,000998,0002,281,472
32Jul 21, 2022 23:1373,797385,199,713360,607,000998,0002,281,472
33Jul 21, 2022 23:1373,808383,927,363360,660,000999,0002,428,928
34Jul 21, 2022 23:1073,845385,416,974359,843,0001,999,0002,428,928
35Jul 21, 2022 23:1073,857384,969,644359,902,0001,999,0002,420,736
36Jul 21, 2022 23:1195,001490,562,905464,506,000998,0002,424,832