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 11:19Hal FHal FScore: 60,194Success
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 11:1956,308342,896,178275,908,92202,281,472
2Apr 27, 2024 11:1956,418335,887,036276,448,17602,273,280
3Apr 27, 2024 11:1959,233310,987,766288,240,0002,001,0002,281,472
4Apr 27, 2024 11:1959,319320,100,703288,660,0002,004,0002,531,328
5Apr 27, 2024 11:1959,325315,200,364288,697,0001,997,0002,289,664
6Apr 27, 2024 11:1959,834317,885,300290,184,0003,001,0002,523,136
7Apr 27, 2024 11:1960,194362,062,306294,952,86702,269,184
8Apr 27, 2024 11:1960,341327,387,489292,674,0002,996,0002,527,232
9Apr 27, 2024 11:1960,878319,570,505296,299,0002,002,0002,289,664
10Apr 27, 2024 11:1961,249324,489,314297,118,0003,001,0002,523,136
11Apr 27, 2024 11:1961,369327,031,892298,711,0001,998,0002,289,664
12Apr 27, 2024 11:1961,813333,620,643300,887,0001,999,0002,289,664