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 listOct 4, 2022 11:53Robert BurkeRobert BurkeScore: 55,386Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 11:5352,926324,617,586259,338,45902,301,952
2Oct 4, 2022 11:5353,012326,015,886259,758,79802,174,976
3Oct 4, 2022 11:5353,235318,175,427260,851,41102,183,168
4Oct 4, 2022 11:5355,354290,189,716270,234,0001,000,0002,281,472
5Oct 4, 2022 11:5355,370296,208,720270,312,0001,001,0002,437,120
6Oct 4, 2022 11:5355,374291,297,167270,331,0001,001,0002,281,472
7Oct 4, 2022 11:5355,386296,401,388269,394,0001,995,0002,281,472
8Oct 4, 2022 11:5355,393298,011,918270,423,0001,001,0002,449,408
9Oct 4, 2022 11:5355,492293,445,875269,912,0001,999,0002,281,472
10Oct 4, 2022 11:5355,895298,459,192271,887,0001,999,0002,445,312
11Oct 4, 2022 11:5355,941296,839,016272,110,0002,000,0002,281,472
12Oct 4, 2022 11:5355,950295,931,582273,157,0001,000,0002,281,472