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 23, 2022 09:20Robert BurkeRobert BurkeScore: 64,901Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 09:2062,330370,211,375305,416,01702,179,072
2Jul 23, 2022 09:2062,353361,685,673305,527,96902,183,168
3Jul 23, 2022 09:2062,728366,788,619307,367,06902,179,072
4Jul 23, 2022 09:2064,851344,115,628315,774,0001,998,0002,445,312
5Jul 23, 2022 09:2064,877341,148,872315,896,0001,999,0002,281,472
6Jul 23, 2022 09:2064,894345,877,807315,982,0001,999,0002,535,424
7Jul 23, 2022 09:2064,901340,142,832316,013,0002,000,0002,281,472
8Jul 23, 2022 09:2064,907348,992,759316,050,0001,994,0002,441,216
9Jul 23, 2022 09:2064,929343,516,629317,152,0001,000,0002,437,120
10Jul 23, 2022 09:2064,958340,683,944317,294,0001,000,0002,445,312
11Jul 23, 2022 09:2065,003341,824,942316,517,0001,996,0002,281,472
12Jul 23, 2022 09:2065,060342,899,310316,795,0001,998,0002,441,216