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 30, 2022 11:35Robert BurkeRobert BurkeScore: 61,516Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 11:3559,401356,683,765291,065,49502,187,264
2Jul 30, 2022 11:0659,433370,260,614291,222,35302,183,168
3Jul 30, 2022 11:0659,440365,951,006291,253,91902,179,072
4Jul 30, 2022 11:3559,469373,749,697291,397,28302,301,952
5Jul 30, 2022 11:3559,477361,609,623291,439,74202,187,264
6Jul 30, 2022 11:0659,566351,678,422291,875,56202,195,456
7Jul 30, 2022 11:3561,329320,692,908298,516,0001,996,0002,277,376
8Jul 30, 2022 11:3561,483324,150,790300,268,0001,000,0002,449,408
9Jul 30, 2022 11:0661,508331,432,741300,386,0001,001,0002,281,472
10Jul 30, 2022 11:0661,509328,349,268300,392,0001,001,0002,445,312
11Jul 30, 2022 11:0661,511326,746,956300,403,0001,001,0002,281,472
12Jul 30, 2022 11:0661,513327,415,179300,415,0001,001,0002,441,216
13Jul 30, 2022 11:0661,516330,527,730300,426,0001,001,0002,441,216
14Jul 30, 2022 11:0661,518329,381,212300,436,0001,001,0002,281,472
15Jul 30, 2022 11:0661,518327,787,065301,440,00002,445,312
16Jul 30, 2022 11:0661,523328,038,369300,464,0001,001,0002,281,472
17Jul 30, 2022 11:3561,525326,752,412299,476,0001,996,0002,445,312
18Jul 30, 2022 11:3561,526327,885,520299,479,0001,996,0002,281,472
19Jul 30, 2022 11:3561,556326,288,658300,626,000998,0002,281,472
20Jul 30, 2022 11:3561,557328,490,729300,631,000998,0002,445,312
21Jul 30, 2022 11:3561,559328,734,210300,640,000998,0002,281,472
22Jul 30, 2022 11:0661,638323,019,113300,024,0002,000,0002,449,408
23Jul 30, 2022 11:3561,892332,376,822301,275,0001,995,0002,445,312
24Jul 30, 2022 11:3561,970331,943,115301,656,0001,997,0002,281,472