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:08Yuriy LyfenkoYuriy LyfenkoScore: 97,001Success
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:0896,907505,190,810472,847,0001,999,0002,342,912
2Jul 20, 2022 15:0896,938501,973,484473,997,000999,0002,527,232
3Jul 20, 2022 15:0896,941547,035,381475,009,21702,195,456
4Jul 20, 2022 15:0896,944500,671,858474,024,0001,000,0002,265,088
5Jul 20, 2022 15:0896,972498,996,849473,161,0002,000,0002,351,104
6Jul 20, 2022 15:0896,974501,349,799474,174,0001,000,0002,265,088
7Jul 20, 2022 15:0897,001504,690,273475,307,00002,265,088
8Jul 20, 2022 15:0897,014501,747,603474,369,000998,0002,527,232
9Jul 20, 2022 15:0897,020505,713,224474,399,0001,000,0002,334,720
10Jul 20, 2022 15:0897,045500,310,938474,522,000998,0002,265,088
11Jul 20, 2022 15:0897,058542,063,580475,583,59602,207,744
12Jul 20, 2022 15:0897,563539,614,864478,060,07102,207,744