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 18:07Robert BurkeRobert BurkeScore: 53,518Success
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 18:0752,798281,383,253256,712,0001,997,0002,531,328
2Oct 4, 2022 18:0752,799279,873,228256,716,0001,997,0002,281,472
3Oct 4, 2022 18:0752,808282,527,247256,761,0001,998,0002,281,472
4Oct 4, 2022 18:0752,820283,268,196256,818,0001,998,0002,281,472
5Oct 4, 2022 18:0752,835283,234,378256,894,0001,999,0002,281,472
6Oct 4, 2022 18:0752,837284,206,631256,900,0001,999,0002,445,312
7Oct 4, 2022 18:0753,518289,963,306261,236,0001,000,0002,281,472
8Oct 4, 2022 18:0753,666327,351,888262,964,88902,187,264
9Oct 4, 2022 18:0753,830332,736,505263,766,34302,191,360
10Oct 4, 2022 18:0753,877290,271,850261,999,0001,999,0002,281,472
11Oct 4, 2022 18:0754,145329,632,771265,310,27302,183,168
12Oct 4, 2022 18:0754,558292,391,634266,332,0001,001,0002,281,472