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 24, 2021 19:41evgenikwtevgenikwtScore: 188,017Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 24, 2021 19:47187,991979,236,021921,157,71602,211,840
2Oct 24, 2021 19:41188,005973,964,778921,224,54802,203,648
3Oct 24, 2021 19:47188,005972,559,648921,225,18302,207,744
4Oct 24, 2021 19:47188,017977,464,795921,283,27502,211,840
5Oct 24, 2021 19:41188,026976,838,391921,325,30002,211,840
6Oct 24, 2021 19:41188,038983,859,674921,386,62402,215,936