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:13Yuriy LyfenkoYuriy LyfenkoScore: 115,800Success
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:13115,696593,704,178565,912,000999,0002,351,104
2Jul 20, 2022 15:13115,696592,105,773566,911,00002,265,088
3Jul 20, 2022 15:13115,731590,496,012567,080,00002,527,232
4Jul 20, 2022 15:13115,744587,461,726566,144,0001,000,0002,363,392
5Jul 20, 2022 15:13115,751591,798,988566,178,0001,000,0002,478,080
6Jul 20, 2022 15:13115,761592,229,447567,230,00002,265,088
7Jul 20, 2022 15:13115,800592,438,327566,421,0001,000,0002,527,232
8Jul 20, 2022 15:13115,848593,628,933565,658,0001,998,0002,265,088
9Jul 20, 2022 15:13115,910592,817,480565,961,0001,999,0002,351,104
10Jul 20, 2022 15:13117,115632,617,839573,861,73402,211,840
11Jul 20, 2022 15:13117,863643,325,613577,531,12702,211,840
12Jul 20, 2022 15:13117,960639,457,222578,005,80902,211,840