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 23, 2022 05:52Bernard TeoBernard TeoScore: 59,354Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 23, 2022 05:5258,524368,684,098286,767,59802,265,088
2Oct 23, 2022 05:5258,600345,695,011287,140,82202,260,992
3Oct 23, 2022 05:5258,623355,505,296287,255,01702,265,088
4Oct 23, 2022 05:5259,315316,328,969289,646,000998,0002,281,472
5Oct 23, 2022 05:5259,327316,271,094288,703,0001,997,0002,281,472
6Oct 23, 2022 05:5259,336312,056,900289,747,000999,0002,281,472
7Oct 23, 2022 05:5259,354310,538,002288,835,0001,998,0002,514,944
8Oct 23, 2022 05:5259,380317,016,307288,965,0001,999,0002,281,472
9Oct 23, 2022 05:5259,416319,323,059289,136,0002,000,0002,281,472
10Oct 23, 2022 05:5259,457319,617,193290,344,000997,0002,281,472
11Oct 23, 2022 05:5259,509320,564,726289,599,0001,997,0002,281,472
12Oct 23, 2022 05:5259,548322,873,189289,788,0001,998,0002,281,472