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:47Yuriy LyfenkoYuriy LyfenkoScore: 91,260Success
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:4791,116474,743,758445,472,000998,0002,527,232
2Jul 20, 2022 17:4791,137477,169,508444,573,0001,998,0002,342,912
3Jul 20, 2022 17:4791,145472,213,048444,611,0001,998,0002,527,232
4Jul 20, 2022 17:4791,146477,990,903444,615,0001,998,0002,265,088
5Jul 20, 2022 17:4791,158471,531,741445,673,000999,0002,338,816
6Jul 20, 2022 17:4791,219472,132,046446,975,00002,342,912
7Jul 20, 2022 17:4791,260474,107,805447,175,00002,334,720
8Jul 20, 2022 17:4791,315474,391,268446,442,0001,000,0002,338,816
9Jul 20, 2022 17:4791,349478,590,908445,612,0001,998,0002,265,088
10Jul 20, 2022 17:4798,058550,211,069480,482,73902,203,648
11Jul 20, 2022 17:4798,171537,219,525481,038,06902,195,456
12Jul 20, 2022 17:4798,696569,221,323483,611,57302,195,456