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 listJun 12, 2024 13:47matsuoka-601matsuoka-601Score: 59,861Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 12, 2024 13:4759,268351,281,313290,414,71502,281,472
2Jun 12, 2024 13:4759,474318,617,549290,422,0001,001,0002,428,928
3Jun 12, 2024 13:4759,528321,743,603289,689,0001,997,0002,293,760
4Jun 12, 2024 13:4759,535316,140,314288,726,0002,997,0002,265,088
5Jun 12, 2024 13:4759,766319,081,019289,853,0002,998,0002,293,760
6Jun 12, 2024 13:4759,850323,050,056292,267,0001,000,0002,293,760
7Jun 12, 2024 13:4759,861316,254,047291,315,0002,002,0002,424,832
8Jun 12, 2024 13:4759,930323,753,340290,660,0002,996,0002,424,832
9Jun 12, 2024 13:4760,639369,893,096297,129,89302,273,280
10Jun 12, 2024 13:4760,926370,971,500298,537,80502,265,088
11Jun 12, 2024 13:4762,586332,203,585303,675,0002,996,0002,420,736
12Jun 12, 2024 13:4762,640330,990,835304,935,0001,999,0002,293,760