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 listDec 3, 2024 08:39A L ManningA L ManningScore: 602,876Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 3, 2024 08:39602,7772,982,964,0362,951,608,0001,999,0002,383,872
2Dec 3, 2024 08:39602,8302,982,696,2882,952,867,000999,0002,281,472
3Dec 3, 2024 08:39602,8302,978,308,6992,953,866,00002,285,568
4Dec 3, 2024 08:39602,8632,980,105,8272,954,027,00002,281,472
5Dec 3, 2024 08:39602,8762,988,397,9892,953,091,000999,0002,281,472
6Dec 3, 2024 08:39602,9062,985,557,0582,953,240,000999,0002,281,472
7Dec 3, 2024 08:39602,9872,980,493,2932,953,638,000999,0002,281,472
8Dec 3, 2024 08:39603,0682,981,725,0052,955,031,00002,367,488
9Dec 3, 2024 08:39603,1352,989,122,5732,953,363,0001,998,0002,367,488