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 28, 2024 19:19Hal FHal FScore: 53,877Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 19:1953,560341,416,862262,442,55502,285,568
2Apr 28, 2024 19:1953,564288,192,492260,460,0002,003,0002,289,664
3Apr 28, 2024 19:1953,565322,504,984262,469,14402,269,184
4Apr 28, 2024 19:1953,611288,944,877259,697,0002,996,0002,289,664
5Apr 28, 2024 19:1953,755289,570,105261,397,0002,003,0002,289,664
6Apr 28, 2024 19:1953,844289,505,822260,840,0002,998,0002,269,184
7Apr 28, 2024 19:1953,877289,939,202262,999,000999,0002,269,184
8Apr 28, 2024 19:1953,882285,479,617262,024,0002,000,0002,265,088
9Apr 28, 2024 19:1954,102287,816,141263,102,0002,000,0002,289,664
10Apr 28, 2024 19:1954,247344,934,764265,811,78002,269,184
11Apr 28, 2024 19:1965,981353,089,382321,306,0002,001,0002,265,088
12Apr 28, 2024 19:1982,129429,444,157400,430,0002,002,0002,265,088