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 listJul 30, 2022 11:03Robert BurkeRobert BurkeScore: 62,310Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 11:0361,371369,800,189300,717,55902,187,264
2Jul 30, 2022 11:0361,397364,116,122300,843,79802,183,168
3Jul 30, 2022 11:0361,401360,190,136300,863,36602,179,072
4Jul 30, 2022 11:0362,294326,883,687304,239,0001,000,0002,281,472
5Jul 30, 2022 11:0362,294331,341,609304,241,0001,000,0002,535,424
6Jul 30, 2022 11:0362,298329,064,274304,258,0001,000,0002,281,472
7Jul 30, 2022 11:0362,310336,008,408303,324,0001,995,0002,281,472
8Jul 30, 2022 11:0362,314336,676,651304,338,0001,001,0002,445,312
9Jul 30, 2022 11:0362,320329,641,846304,367,0001,001,0002,281,472
10Jul 30, 2022 11:0362,335331,356,987303,446,0001,996,0002,441,216
11Jul 30, 2022 11:0362,611331,429,486304,796,0001,998,0002,445,312
12Jul 30, 2022 11:0363,073329,433,189308,058,0001,000,0002,441,216