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 06:57matsuoka-601matsuoka-601Score: 64,751Success
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 06:5764,232340,685,539309,744,0004,995,0002,473,984
2Jun 12, 2024 06:5764,299342,916,073312,063,0003,000,0002,416,640
3Jun 12, 2024 06:5764,302340,711,884309,077,0006,001,0002,498,560
4Jun 12, 2024 06:5764,596373,716,229316,522,15202,256,896
5Jun 12, 2024 06:5764,649378,563,658316,781,12002,379,776
6Jun 12, 2024 06:5764,737342,876,877311,207,0006,004,0002,334,720
7Jun 12, 2024 06:5764,751340,405,542312,275,0005,004,0002,494,464
8Jun 12, 2024 06:5764,881342,182,002307,920,0009,997,0002,482,176
9Jun 12, 2024 06:5765,107396,082,916319,023,68402,260,992
10Jun 12, 2024 06:5765,391346,440,609313,409,0007,009,0002,322,432
11Jun 12, 2024 06:5771,098375,415,333344,376,0004,004,0002,478,080
12Jun 12, 2024 06:5794,623490,697,502454,660,0008,993,0002,285,568