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 20, 2022 15:11Yuriy LyfenkoYuriy LyfenkoScore: 97,012Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 15:1196,889507,588,243472,757,0001,998,0002,265,088
2Jul 20, 2022 15:1196,939501,069,658473,001,0002,000,0002,342,912
3Jul 20, 2022 15:1196,948501,875,561474,047,0001,000,0002,265,088
4Jul 20, 2022 15:1196,966497,197,503474,131,0001,000,0002,347,008
5Jul 20, 2022 15:1196,985494,669,014474,226,0001,000,0002,527,232
6Jul 20, 2022 15:1196,987545,251,041475,235,88602,207,744
7Jul 20, 2022 15:1197,012505,790,141474,359,0001,000,0002,457,600
8Jul 20, 2022 15:1197,017505,472,155474,384,0001,000,0002,338,816
9Jul 20, 2022 15:1197,027499,362,474474,433,0001,000,0002,347,008
10Jul 20, 2022 15:1197,063506,688,758473,609,0001,998,0002,347,008
11Jul 20, 2022 15:1197,626535,065,055478,366,86502,244,608
12Jul 20, 2022 15:1197,648562,465,925478,472,85502,207,744