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 listNov 26, 2024 12:23NoSIMD_C#NoSIMD_C#Score: 1,149,450Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 26, 2024 12:231,149,2415,659,317,6545,525,335,000105,948,0002,297,856
2Nov 26, 2024 12:231,149,2925,658,382,2655,527,578,000103,954,0002,297,856
3Nov 26, 2024 12:231,149,3795,664,832,5315,538,006,00093,949,0002,293,760
4Nov 26, 2024 12:231,149,4275,667,828,6815,525,265,000106,927,0002,539,520
5Nov 26, 2024 12:231,149,4505,660,737,8715,517,362,000114,945,0002,297,856
6Nov 26, 2024 12:231,149,4565,663,241,7525,525,385,000106,949,0002,293,760
7Nov 26, 2024 12:231,149,4825,661,738,5475,525,531,000106,932,0002,293,760
8Nov 26, 2024 12:231,149,5485,669,394,3325,509,856,000122,929,0002,293,760
9Nov 26, 2024 12:231,149,6185,662,275,5685,523,186,000109,943,0002,293,760