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:36Yuriy LyfenkoYuriy LyfenkoScore: 108,859Success
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:36108,6181,058,198,442532,229,00002,523,136
2Jul 9, 2021 12:36108,6791,058,802,016531,527,000999,0002,482,176
3Jul 9, 2021 12:36108,6821,060,550,451531,545,000999,0002,482,176
4Jul 9, 2021 12:36108,7081,058,426,270531,668,000999,0002,482,176
5Jul 9, 2021 12:36108,7351,062,636,288530,804,0001,999,0002,482,176
6Jul 9, 2021 12:36108,7731,065,912,994531,991,000998,0002,482,176
7Jul 9, 2021 12:36108,8591,058,509,665532,411,000998,0002,482,176
8Jul 9, 2021 12:36108,9081,060,427,061532,650,000999,0002,478,080
9Jul 9, 2021 12:36108,9171,059,969,024532,695,000999,0002,260,992
10Jul 9, 2021 12:36109,7391,097,997,775537,720,05602,195,456
11Jul 9, 2021 12:36109,7531,098,292,885537,790,13002,195,456
12Jul 9, 2021 12:36109,9681,105,172,350538,845,62702,195,456