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 3, 2022 03:59Bernard TeoBernard TeoScore: 67,684Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 3, 2022 03:5967,627357,954,727331,372,00002,281,472
2Oct 3, 2022 03:5967,650401,215,978331,483,07402,273,280
3Oct 3, 2022 03:5967,665406,031,397331,556,91202,265,088
4Oct 3, 2022 03:5967,671357,456,284330,589,000998,0002,281,472
5Oct 3, 2022 03:5967,679361,262,332330,630,000998,0002,400,256
6Oct 3, 2022 03:5967,683357,692,989329,652,0001,997,0002,404,352
7Oct 3, 2022 03:5967,684361,613,298330,654,000998,0002,281,472
8Oct 3, 2022 03:5967,695355,939,781330,708,000999,0002,277,376
9Oct 3, 2022 03:5967,721353,804,523330,835,000999,0002,392,064
10Oct 3, 2022 03:5967,725360,787,688330,855,000999,0002,281,472
11Oct 3, 2022 03:5967,734357,337,978330,900,000999,0002,281,472
12Oct 3, 2022 03:5967,984396,241,981333,120,36002,265,088