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 15:28Robert BurkeRobert BurkeScore: 55,883Success
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 15:2855,749333,885,690273,167,86402,174,976
2Oct 4, 2022 15:2855,758330,522,645273,212,16102,174,976
3Oct 4, 2022 15:2855,830295,761,575271,569,0001,996,0002,445,312
4Oct 4, 2022 15:2855,861297,514,840271,722,0001,997,0002,445,312
5Oct 4, 2022 15:2855,870297,358,403271,767,0001,998,0002,437,120
6Oct 4, 2022 15:2855,871297,392,513271,768,0001,998,0002,281,472
7Oct 4, 2022 15:2855,883297,402,992271,829,0001,998,0002,281,472
8Oct 4, 2022 15:2855,898297,190,900271,902,0001,999,0002,449,408
9Oct 4, 2022 15:2855,919295,665,187273,004,0001,000,0002,437,120
10Oct 4, 2022 15:2856,554302,003,616275,113,0002,000,0002,449,408
11Oct 4, 2022 15:2856,672301,099,794275,696,0001,997,0002,281,472
12Oct 4, 2022 15:2857,161343,287,319280,089,84702,256,896