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 listFeb 5, 2025 12:21Oleg KovalovOleg KovalovScore: 2,398,471Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 5, 2025 12:212,394,83411,770,121,98311,726,692,0007,993,0002,334,720
2Feb 5, 2025 12:212,394,85811,767,960,68211,724,811,0009,993,0002,473,984
3Feb 5, 2025 12:212,395,68111,773,152,50511,727,846,00010,991,0002,457,600
4Feb 5, 2025 12:212,397,14211,780,338,33511,740,999,0004,996,0002,310,144
5Feb 5, 2025 12:212,398,47111,786,284,44611,740,520,00011,990,0002,531,328
6Feb 5, 2025 12:212,398,98811,795,007,51611,742,050,00012,990,0002,523,136
7Feb 5, 2025 12:212,400,48611,802,403,16311,749,390,00012,990,0002,473,984
8Feb 5, 2025 12:212,401,95111,801,820,04511,751,575,00017,987,0002,367,488
9Feb 5, 2025 12:212,402,06011,805,273,60611,755,106,00014,987,0002,408,448