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:50Robert BurkeRobert BurkeScore: 55,442Success
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:5052,932321,900,524259,367,64602,183,168
2Oct 4, 2022 15:5052,968330,573,040259,545,53702,191,360
3Oct 4, 2022 15:5053,001324,924,605259,705,15902,174,976
4Oct 4, 2022 15:5055,373291,970,293270,327,0001,001,0002,281,472
5Oct 4, 2022 15:5055,389297,638,312270,405,0001,001,0002,281,472
6Oct 4, 2022 15:5055,437297,706,426269,645,0001,997,0002,281,472
7Oct 4, 2022 15:5055,442301,518,491270,666,000998,0002,449,408
8Oct 4, 2022 15:5055,469292,891,381269,802,0001,998,0002,441,216
9Oct 4, 2022 15:5055,479298,167,119269,850,0001,998,0002,281,472
10Oct 4, 2022 15:5055,831297,279,225271,578,0001,996,0002,281,472
11Oct 4, 2022 15:5055,879296,615,442271,811,0001,998,0002,281,472
12Oct 4, 2022 15:5055,985298,012,889273,327,0001,001,0002,453,504