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:58Robert BurkeRobert BurkeScore: 70,309Success
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:5867,646392,138,034331,464,52202,289,664
2Jul 22, 2022 00:0467,655397,880,129331,509,45002,289,664
3Jul 21, 2022 23:5867,661389,123,710331,536,56002,289,664
4Jul 22, 2022 00:0867,667395,461,709331,569,33902,281,472
5Jul 21, 2022 23:5867,685395,630,079331,654,60202,285,568
6Jul 22, 2022 00:0467,702391,444,354331,739,96902,285,568
7Jul 22, 2022 00:0867,709393,716,531331,774,56102,285,568
8Jul 22, 2022 00:0467,712391,560,697331,787,04802,293,760
9Jul 22, 2022 00:0470,216365,126,397343,056,0001,000,0002,281,472
10Jul 22, 2022 00:0870,222369,282,465343,090,0001,000,0002,281,472
11Jul 22, 2022 00:0870,250369,658,602344,227,00002,428,928
12Jul 21, 2022 23:5870,250365,078,911344,223,00002,281,472
13Jul 22, 2022 00:0470,262375,777,618343,289,000997,0002,281,472
14Jul 21, 2022 23:5870,264369,807,796344,296,00002,281,472
15Jul 21, 2022 23:5870,279374,726,621342,370,0001,996,0002,428,928
16Jul 21, 2022 23:5870,286369,942,367342,407,0001,996,0002,428,928
17Jul 22, 2022 00:0470,299375,957,603343,466,0001,001,0002,281,472
18Jul 22, 2022 00:0870,305370,185,677342,497,0001,997,0002,281,472
19Jul 22, 2022 00:0470,309375,234,891344,513,00002,281,472
20Jul 22, 2022 00:0870,327364,716,603342,604,0001,997,0002,420,736
21Jul 22, 2022 00:0470,329370,811,310343,614,000998,0002,281,472
22Jul 22, 2022 00:0870,332371,265,113343,630,000998,0002,433,024
23Jul 22, 2022 00:0470,334369,422,424343,641,000998,0002,428,928
24Jul 22, 2022 00:0870,353365,667,739343,730,000999,0002,437,120
25Jul 22, 2022 00:0470,357368,036,043343,748,000999,0002,281,472
26Jul 21, 2022 23:5870,389368,012,585342,907,0001,999,0002,428,928
27Jul 22, 2022 00:0870,400362,622,070343,960,000999,0002,277,376
28Jul 22, 2022 00:0870,426368,495,656344,088,0001,000,0002,281,472
29Jul 21, 2022 23:5870,445364,714,962344,182,0001,000,0002,433,024
30Jul 21, 2022 23:5870,460368,798,303345,255,00002,281,472
31Jul 21, 2022 23:5870,534370,708,250344,619,000998,0002,428,928
32Jul 22, 2022 00:0470,537369,744,521344,631,000998,0002,428,928
33Jul 21, 2022 23:5870,701372,024,993345,437,000998,0002,281,472
34Jul 22, 2022 00:0870,715372,954,520345,507,000998,0002,281,472
35Jul 22, 2022 00:0470,744369,830,364345,650,000998,0002,428,928
36Jul 22, 2022 00:0874,720416,032,283366,128,65002,293,760