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 6, 2025 08:57Oleg KovalovOleg KovalovScore: 602,392Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 6, 2025 08:57602,3272,979,491,6772,948,406,0002,998,0002,482,176
2Feb 6, 2025 08:57602,3452,979,824,2122,949,493,0001,998,0002,330,624
3Feb 6, 2025 08:57602,3482,982,934,4182,948,508,0002,998,0002,330,624
4Feb 6, 2025 08:57602,3552,985,267,1352,948,543,0002,998,0002,347,008
5Feb 6, 2025 08:57602,3922,977,728,7152,949,723,0001,999,0002,322,432
6Feb 6, 2025 08:57602,3972,977,170,9922,949,747,0001,999,0002,351,104
7Feb 6, 2025 08:57602,3982,984,951,3282,948,752,0002,997,0002,330,624
8Feb 6, 2025 08:57602,4612,982,462,5642,949,060,0002,998,0002,330,624
9Feb 6, 2025 08:57602,4702,983,276,1332,948,106,0003,997,0002,330,624