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 17:08Yuriy LyfenkoYuriy LyfenkoScore: 96,445Success
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 17:0896,331500,941,963470,023,0002,000,0002,265,088
2Jul 20, 2022 17:0896,340493,266,668471,065,0001,000,0002,265,088
3Jul 20, 2022 17:0896,355495,676,013472,138,00002,338,816
4Jul 20, 2022 17:0896,379496,343,462472,255,00002,342,912
5Jul 20, 2022 17:0896,386493,779,353472,290,00002,265,088
6Jul 20, 2022 17:0896,395499,233,254470,337,0001,997,0002,265,088
7Jul 20, 2022 17:0896,445498,894,469471,583,000999,0002,269,184
8Jul 20, 2022 17:0896,452501,228,853471,616,000999,0002,527,232
9Jul 20, 2022 17:0896,453497,613,281471,620,000999,0002,347,008
10Jul 20, 2022 17:0897,493533,165,092477,715,57502,203,648
11Jul 20, 2022 17:0897,645532,292,218478,462,12702,203,648
12Jul 20, 2022 17:0898,158537,378,412480,972,78602,207,744