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 listApr 27, 2024 18:43Hal FHal FScore: 61,760Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 18:4361,557334,351,752298,634,0002,996,0002,289,664
2Apr 27, 2024 18:4361,603328,149,576298,855,0002,998,0002,289,664
3Apr 27, 2024 18:4361,620330,537,212298,939,0002,999,0002,289,664
4Apr 27, 2024 18:4361,623326,405,040299,953,0001,999,0002,289,664
5Apr 27, 2024 18:4361,738329,791,216301,514,0001,001,0002,269,184
6Apr 27, 2024 18:4361,750330,008,591299,579,0002,995,0002,289,664
7Apr 27, 2024 18:4361,760334,321,979300,629,0001,997,0002,289,664
8Apr 27, 2024 18:4361,851325,457,345300,071,0003,000,0002,289,664
9Apr 27, 2024 18:4362,195369,203,280304,754,80402,277,376
10Apr 27, 2024 18:4362,584378,132,301306,661,00302,269,184
11Apr 27, 2024 18:4362,610376,321,511306,790,63502,277,376
12Apr 27, 2024 18:4376,910400,780,807373,859,0002,998,0002,265,088