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 listAug 22, 2024 18:19Andrey LikhachevAndrey LikhachevScore: 155,194Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 22, 2024 18:19154,998787,040,102757,491,0001,998,0002,363,392
2Aug 22, 2024 18:19155,001784,812,723757,507,0001,998,0002,293,760
3Aug 22, 2024 18:19155,011786,654,238757,555,0001,998,0002,363,392
4Aug 22, 2024 18:19155,044786,587,957757,715,0001,999,0002,363,392
5Aug 22, 2024 18:19155,079779,508,100758,890,000999,0002,363,392
6Aug 22, 2024 18:19155,100793,050,360758,989,000999,0002,355,200
7Aug 22, 2024 18:19155,194789,799,760758,455,0001,998,0002,293,760
8Aug 22, 2024 18:19155,299792,863,812759,967,000999,0002,293,760
9Aug 22, 2024 18:19155,337782,484,880761,151,00002,293,760
10Aug 22, 2024 18:19155,785824,872,649763,348,32302,207,744
11Aug 22, 2024 18:19155,869844,422,103763,757,76602,211,840
12Aug 22, 2024 18:19164,878878,267,936807,902,40402,211,840