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 09:21Robert BurkeRobert BurkeScore: 60,553Success
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 09:2159,992361,285,080293,961,24802,179,072
2Oct 4, 2022 09:2160,025361,518,600294,120,88902,174,976
3Oct 4, 2022 09:2160,031357,399,520294,151,60002,183,168
4Oct 4, 2022 09:2160,052365,984,913294,254,63502,179,072
5Oct 4, 2022 09:2160,517321,564,955295,531,0001,001,0002,281,472
6Oct 4, 2022 09:2160,528315,674,349294,592,0001,997,0002,441,216
7Oct 4, 2022 09:2160,542322,846,472294,659,0001,997,0002,281,472
8Oct 4, 2022 09:2160,543328,273,301295,664,000998,0002,281,472
9Oct 4, 2022 09:2160,544318,643,634295,670,000998,0002,281,472
10Oct 4, 2022 09:2160,544320,624,486294,671,0001,997,0002,445,312
11Oct 4, 2022 09:2160,545325,467,167294,674,0001,997,0002,441,216
12Oct 4, 2022 09:2160,545321,741,298295,674,000998,0002,437,120
13Oct 4, 2022 09:2160,553315,850,054294,713,0001,998,0002,281,472
14Oct 4, 2022 09:2160,586320,428,104294,870,0001,999,0002,281,472
15Oct 4, 2022 09:2160,599319,373,384294,937,0001,999,0002,449,408
16Oct 4, 2022 09:2160,655316,897,096296,208,0001,000,0002,453,504
17Oct 4, 2022 09:2160,723361,427,778297,540,49202,179,072
18Oct 4, 2022 09:2160,725378,080,421297,551,11202,179,072
19Oct 4, 2022 09:2160,748325,758,610295,668,0001,997,0002,281,472
20Oct 4, 2022 09:2160,751326,030,649295,682,0001,997,0002,453,504
21Oct 4, 2022 09:2160,828321,741,237296,057,0002,000,0002,281,472
22Oct 4, 2022 09:2161,159321,892,732297,683,0001,997,0002,445,312
23Oct 4, 2022 09:2161,720328,586,928300,433,0001,996,0002,281,472
24Oct 4, 2022 09:2162,456328,678,474305,035,0001,000,0002,449,408