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 20, 2022 17:07Robert BurkeRobert BurkeScore: 81,933Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 17:0778,563440,010,985384,956,46902,281,472
2Jul 20, 2022 17:0778,601442,971,898385,142,96402,281,472
3Jul 20, 2022 17:0778,614450,267,700385,206,60802,252,800
4Jul 20, 2022 17:0781,878430,161,964400,201,0001,000,0002,281,472
5Jul 20, 2022 17:0781,881423,125,825401,217,00002,281,472
6Jul 20, 2022 17:0781,894426,160,878401,283,00002,424,832
7Jul 20, 2022 17:0781,933433,295,718400,472,000998,0002,281,472
8Jul 20, 2022 17:0781,957424,131,880400,592,000998,0002,281,472
9Jul 20, 2022 17:0781,959423,650,188400,599,000999,0002,277,376
10Jul 20, 2022 17:0781,959422,359,153401,599,00002,428,928
11Jul 20, 2022 17:0781,962427,915,650400,616,000999,0002,281,472
12Jul 20, 2022 17:0782,021430,714,403399,903,0001,999,0002,281,472