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: 123,489Success
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:13101,797574,654,431498,806,67002,293,760
2Dec 10, 2021 02:18101,835562,295,087498,989,39602,293,760
3Dec 10, 2021 02:18101,846568,599,030499,047,09202,285,568
4Dec 10, 2021 02:18101,852583,058,641499,076,41002,281,472
5Jul 20, 2022 15:13102,012595,317,992499,856,54002,289,664
6Jul 20, 2022 15:13102,054569,930,519500,062,82102,285,568
7Jul 20, 2022 15:13123,373630,366,547603,530,000999,0002,527,232
8Dec 10, 2021 02:18123,383630,678,385603,579,000999,0002,265,088
9Jul 20, 2022 15:13123,390630,678,705603,612,000999,0002,265,088
10Jul 20, 2022 15:13123,428631,189,097602,799,0001,999,0002,265,088
11Dec 10, 2021 02:18123,434633,057,039602,828,0001,999,0002,527,232
12Jul 20, 2022 15:13123,466632,692,563603,986,000999,0002,289,664
13Dec 10, 2021 02:18123,489630,090,375605,095,00002,265,088
14Dec 10, 2021 02:18123,524626,756,769604,268,0001,000,0002,289,664
15Dec 10, 2021 02:18123,537632,702,319604,330,0001,000,0002,293,760
16Jul 20, 2022 15:13123,544631,349,661604,364,0001,000,0002,412,544
17Dec 10, 2021 02:18123,578635,660,416603,532,0001,998,0002,265,088
18Jul 20, 2022 15:13123,601632,188,356604,645,000999,0002,285,568
19Dec 10, 2021 02:18123,607633,960,477603,676,0001,998,0002,293,760
20Jul 20, 2022 15:13123,657628,490,685604,918,000999,0002,289,664
21Jul 20, 2022 15:13123,694631,083,968605,099,0001,000,0002,265,088
22Dec 10, 2021 02:18123,730631,128,568605,276,0001,000,0002,527,232
23Jul 20, 2022 15:13123,735636,491,490606,302,00002,269,184
24Dec 10, 2021 02:18123,783633,100,745604,537,0001,998,0002,527,232