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 18:31Hal FHal FScore: 54,363Success
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 18:3153,263318,001,206260,987,92902,277,376
2Apr 27, 2024 18:3153,290315,718,307261,123,09602,277,376
3Apr 27, 2024 18:3153,602288,541,538260,655,0001,997,0002,531,328
4Apr 27, 2024 18:3153,612287,967,193259,704,0002,996,0002,531,328
5Apr 27, 2024 18:3153,916335,726,237264,189,03402,269,184
6Apr 27, 2024 18:3154,064293,758,058261,917,0002,999,0002,289,664
7Apr 27, 2024 18:3154,363296,154,317264,379,0002,002,0002,527,232
8Apr 27, 2024 18:3154,444295,073,186263,778,0002,997,0002,289,664
9Apr 27, 2024 18:3154,494295,187,250265,019,0002,000,0002,289,664
10Apr 27, 2024 18:3154,524286,539,058264,165,0003,001,0002,351,104
11Apr 27, 2024 18:3154,525295,231,483265,172,0002,001,0002,289,664
12Apr 27, 2024 18:3154,566293,846,831265,370,0002,002,0002,265,088