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 listJan 13, 2025 07:30Ian MckibbenIan MckibbenScore: 2,814,201Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 13, 2025 07:302,791,30813,708,327,52213,555,477,000121,932,0002,281,472
2Jan 13, 2025 07:302,798,89513,748,881,03213,569,664,000144,921,0002,277,376
3Jan 13, 2025 07:302,812,74713,812,530,33513,673,510,000108,948,0002,265,088
4Jan 13, 2025 07:302,813,55213,820,415,60613,656,476,000129,928,0002,277,376
5Jan 13, 2025 07:302,814,20113,822,716,44713,651,649,000137,935,0002,277,376
6Jan 13, 2025 07:302,814,45913,827,274,66613,670,912,000119,937,0002,277,376
7Jan 13, 2025 07:302,815,92513,831,395,42213,654,106,000143,927,0002,277,376
8Jan 13, 2025 07:302,816,62113,838,785,45913,675,514,000125,931,0002,277,376
9Jan 13, 2025 07:302,863,71114,061,375,60313,897,251,000134,934,0002,277,376