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 listOct 4, 2022 12:24Robert BurkeRobert BurkeScore: 60,494Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 12:2459,955355,119,017293,777,38502,183,168
2Oct 4, 2022 12:2459,967351,456,771293,839,32802,174,976
3Oct 4, 2022 12:2460,087317,114,324293,424,0001,001,0002,277,376
4Oct 4, 2022 12:2460,090317,858,945292,444,0001,996,0002,277,376
5Oct 4, 2022 12:2460,107322,014,273293,524,0001,001,0002,281,472
6Oct 4, 2022 12:2460,305325,419,252294,495,0001,001,0002,281,472
7Oct 4, 2022 12:2460,494318,287,752294,426,0001,996,0002,281,472
8Oct 4, 2022 12:2461,085323,771,579298,314,0001,001,0002,281,472
9Oct 4, 2022 12:2461,301322,345,598299,376,0001,001,0002,281,472
10Oct 4, 2022 12:2461,970328,560,440301,657,0001,997,0002,281,472
11Oct 4, 2022 12:2461,983327,881,650301,719,0001,998,0002,281,472
12Oct 4, 2022 12:2462,756372,764,990307,504,24602,179,072