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 listSep 20, 2022 17:33Bernard TeoBernard TeoScore: 80,227Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 20, 2022 17:3380,163420,022,109390,801,0001,998,0002,400,256
2Sep 20, 2022 17:3380,183410,366,576391,900,000999,0002,281,472
3Sep 20, 2022 17:3380,186419,693,577390,913,0001,999,0002,281,472
4Sep 20, 2022 17:3380,189413,587,400390,925,0001,999,0002,396,160
5Sep 20, 2022 17:3380,204420,902,915391,001,0002,000,0002,400,256
6Sep 20, 2022 17:3380,205420,414,722391,005,0002,000,0002,392,064
7Sep 20, 2022 17:3380,227416,192,825391,112,0002,000,0002,281,472
8Sep 20, 2022 17:3380,566417,970,550393,775,000999,0002,396,160
9Sep 20, 2022 17:3380,786423,974,020393,851,0001,999,0002,281,472
10Sep 20, 2022 17:3382,739462,310,892405,419,42302,269,184
11Sep 20, 2022 17:3382,831487,313,258405,873,78302,273,280
12Sep 20, 2022 17:3384,683483,894,188414,949,10702,273,280