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 listMar 8, 2024 02:50Huy Duc LeHuy Duc LeScore: 169,856Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 8, 2024 02:50158,852853,942,130778,372,52002,252,800
2Mar 8, 2024 02:50159,239851,459,811780,268,80202,260,992
3Mar 8, 2024 02:50160,643846,022,676787,148,74102,248,704
4Mar 8, 2024 02:50169,499861,131,101734,597,00095,947,0002,301,952
5Mar 8, 2024 02:50169,516852,265,911716,680,000113,949,0002,387,968
6Mar 8, 2024 02:50169,657853,386,649719,275,000112,042,0002,285,568
7Mar 8, 2024 02:50169,856861,008,400717,253,000115,040,0002,420,736
8Mar 8, 2024 02:50170,277858,828,898734,434,00099,923,0002,387,968
9Mar 8, 2024 02:50170,327862,261,266735,650,00098,952,0002,301,952
10Mar 8, 2024 02:50171,092868,392,013742,424,00095,925,0002,306,048
11Mar 8, 2024 02:50171,383866,148,765719,666,000120,111,0002,285,568
12Mar 8, 2024 02:50172,962873,868,414729,584,000117,932,0002,285,568