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 22:56Robert BurkeRobert BurkeScore: 74,099Success
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 22:5670,421399,017,696345,061,46902,289,664
2Jul 21, 2022 22:5670,460399,456,884345,253,27302,285,568
3Jul 21, 2022 22:5670,478399,307,220345,343,32302,285,568
4Jul 21, 2022 22:5674,055385,456,835361,870,000999,0002,428,928
5Jul 21, 2022 22:5674,067383,168,227361,927,000999,0002,281,472
6Jul 21, 2022 22:5674,093389,548,937362,057,0001,000,0002,281,472
7Jul 21, 2022 22:5674,099384,404,256363,084,00002,433,024
8Jul 21, 2022 22:5674,103384,663,998362,103,0001,000,0002,277,376
9Jul 21, 2022 22:5674,109384,257,550363,136,00002,424,832
10Jul 21, 2022 22:5674,126385,283,821363,216,00002,281,472
11Jul 21, 2022 22:5674,134392,957,175363,256,00002,428,928
12Jul 21, 2022 22:5674,142390,539,487362,298,0001,000,0002,281,472