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,819Success
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,190342,176,966290,032,06402,289,664
2Jun 12, 2024 13:4759,343368,124,543290,779,72702,281,472
3Jun 12, 2024 13:4759,536313,127,225289,729,0001,998,0002,293,760
4Jun 12, 2024 13:4759,550317,790,595289,795,0001,998,0002,523,136
5Jun 12, 2024 13:4759,571314,684,610289,901,0001,999,0002,293,760
6Jun 12, 2024 13:4759,795320,363,536289,995,0002,999,0002,293,760
7Jun 12, 2024 13:4759,819314,431,214290,114,0003,001,0002,420,736
8Jun 12, 2024 13:4759,947317,400,642290,742,0002,997,0002,433,024
9Jun 12, 2024 13:4760,022321,270,397292,106,0002,000,0002,293,760
10Jun 12, 2024 13:4760,046316,350,563291,223,0003,002,0002,293,760
11Jun 12, 2024 13:4760,339360,086,949295,661,84502,281,472
12Jun 12, 2024 13:4761,223332,625,886297,993,0001,999,0002,293,760