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 listJul 9, 2021 12:25Yuriy LyfenkoYuriy LyfenkoScore: 105,313Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:25105,2271,046,586,757513,614,0001,998,0002,482,176
2Jul 9, 2021 12:25105,2291,045,633,779514,621,000999,0002,478,080
3Jul 9, 2021 12:25105,2541,046,782,636513,748,0001,999,0002,482,176
4Jul 9, 2021 12:25105,2701,041,946,532513,825,0001,999,0002,478,080
5Jul 9, 2021 12:25105,2711,045,322,544514,828,000999,0002,473,984
6Jul 9, 2021 12:25105,2911,046,500,518513,927,0001,999,0002,478,080
7Jul 9, 2021 12:25105,3131,042,850,198514,033,0002,000,0002,523,136
8Jul 9, 2021 12:25105,3521,038,222,982516,226,00002,482,176
9Jul 9, 2021 12:25105,3651,041,666,522515,289,0001,000,0002,482,176
10Jul 9, 2021 12:25120,4951,145,667,557590,424,70002,195,456
11Jul 9, 2021 12:25120,8071,165,671,751591,953,19102,191,360
12Jul 9, 2021 12:25120,8501,171,484,316592,164,48402,203,648