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 01:44Robert BurkeRobert BurkeScore: 70,036Success
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 01:4467,655387,181,376331,507,91602,289,664
2Jul 22, 2022 01:4467,659393,129,947331,529,59202,277,376
3Jul 22, 2022 01:4467,660410,114,486331,534,08302,289,664
4Jul 22, 2022 01:4467,678401,547,663331,621,21602,289,664
5Jul 22, 2022 01:4467,680390,755,919331,630,43402,285,568
6Jul 22, 2022 01:4467,696387,065,396331,710,96702,285,568
7Jul 22, 2022 01:4470,009366,195,469342,042,0001,000,0002,514,944
8Jul 22, 2022 01:4470,012366,861,895343,058,00002,428,928
9Jul 22, 2022 01:4470,018366,275,537342,088,0001,000,0002,424,832
10Jul 22, 2022 01:4470,025364,077,305343,122,00002,281,472
11Jul 22, 2022 01:4470,029365,446,593343,142,00002,428,928
12Jul 22, 2022 01:4470,034371,500,755342,167,0001,000,0002,424,832
13Jul 22, 2022 01:4470,036365,237,284342,176,0001,000,0002,281,472
14Jul 22, 2022 01:4470,054361,745,578343,266,00002,428,928
15Jul 22, 2022 01:4470,058367,995,290343,286,00002,424,832
16Jul 22, 2022 01:4470,059372,669,785343,287,00002,281,472
17Jul 22, 2022 01:4470,070369,055,912342,342,0001,001,0002,281,472
18Jul 22, 2022 01:4470,077368,581,212342,381,000998,0002,281,472
19Jul 22, 2022 01:4470,078370,161,423343,384,00002,424,832
20Jul 22, 2022 01:4470,090368,322,421343,440,00002,281,472
21Jul 22, 2022 01:4470,098365,189,737341,482,0001,996,0002,428,928
22Jul 22, 2022 01:4470,123369,779,061342,605,000998,0002,281,472
23Jul 22, 2022 01:4470,123368,988,805341,605,0001,997,0002,281,472
24Jul 22, 2022 01:4470,158363,925,235341,774,0001,998,0002,277,376