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:49Bernard TeoBernard TeoScore: 57,832Success
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:4957,710305,578,423280,781,0001,998,0002,281,472
2Oct 23, 2022 05:4957,738306,289,374280,919,0001,999,0002,400,256
3Oct 23, 2022 05:4957,762306,540,965282,036,0001,000,0002,396,160
4Oct 23, 2022 05:4957,791311,963,364283,176,00002,396,160
5Oct 23, 2022 05:4957,805315,566,111282,245,0001,000,0002,281,472
6Oct 23, 2022 05:4957,810312,512,870282,270,0001,000,0002,281,472
7Oct 23, 2022 05:4957,832312,104,089282,378,0001,001,0002,281,472
8Oct 23, 2022 05:4957,838308,608,476282,404,0001,001,0002,281,472
9Oct 23, 2022 05:4957,878309,425,593283,604,00002,404,352
10Oct 23, 2022 05:4959,436354,689,381291,237,50202,260,992
11Oct 23, 2022 05:4959,456350,400,888291,332,00802,269,184
12Oct 23, 2022 05:4961,513376,808,094301,414,98502,277,376