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 15:29Robert 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 15:2952,957329,967,070259,487,48502,183,168
2Oct 4, 2022 15:2952,993325,320,636259,664,96302,174,976
3Oct 4, 2022 15:2953,924335,806,705264,228,66802,183,168
4Oct 4, 2022 15:2955,352298,376,468270,223,0001,000,0002,445,312
5Oct 4, 2022 15:2955,352296,623,499270,227,0001,000,0002,445,312
6Oct 4, 2022 15:2955,379293,204,426270,355,0001,001,0002,449,408
7Oct 4, 2022 15:2955,386297,041,656270,388,0001,001,0002,445,312
8Oct 4, 2022 15:2955,402297,298,725269,472,0001,996,0002,281,472
9Oct 4, 2022 15:2955,877291,800,749271,800,0001,998,0002,449,408
10Oct 4, 2022 15:2955,919299,134,169272,004,0002,000,0002,281,472
11Oct 4, 2022 15:2955,925295,264,011272,032,0002,000,0002,441,216
12Oct 4, 2022 15:2956,777301,217,853277,206,0001,000,0002,445,312