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 10, 2024 22:30SemyonSemyonScore: 2,798,888Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 10, 2024 22:302,791,85713,713,785,90113,546,178,000133,922,0002,514,944
2Nov 10, 2024 22:302,794,26713,722,584,66213,557,970,000133,940,0002,281,472
3Nov 10, 2024 22:302,796,67113,738,762,05413,548,771,000154,917,0002,281,472
4Nov 10, 2024 22:302,797,71613,742,194,07113,563,885,000144,923,0002,281,472
5Nov 10, 2024 22:302,798,88813,749,969,44213,568,631,000145,920,0002,375,680
6Nov 10, 2024 22:302,813,47813,813,776,76613,696,082,00089,961,0002,281,472
7Nov 10, 2024 22:302,814,97513,826,984,75113,647,449,000145,929,0002,281,472
8Nov 10, 2024 22:302,822,23213,863,527,64413,694,998,000133,941,0002,281,472
9Nov 10, 2024 22:302,843,12613,969,173,01613,797,393,000133,926,0002,281,472