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:24Yuriy LyfenkoYuriy LyfenkoScore: 104,972Success
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:24104,8131,040,325,342512,587,000999,0002,486,272
2Jul 9, 2021 12:24104,8251,039,720,673512,645,000999,0002,482,176
3Jul 9, 2021 12:24104,8331,040,736,054511,682,0001,998,0002,478,080
4Jul 9, 2021 12:24104,8441,040,084,485511,738,0001,998,0002,478,080
5Jul 9, 2021 12:24104,8611,039,627,791511,822,0001,999,0002,478,080
6Jul 9, 2021 12:24104,9111,038,150,756513,063,0001,000,0002,478,080
7Jul 9, 2021 12:24104,9721,040,155,273512,368,0001,997,0002,478,080
8Jul 9, 2021 12:24104,9891,041,395,644513,449,000998,0002,478,080
9Jul 9, 2021 12:24105,0001,041,071,325513,501,000999,0002,478,080
10Jul 9, 2021 12:24120,4401,156,853,164590,153,67602,211,840
11Jul 9, 2021 12:24120,5051,143,529,600590,475,32702,191,360
12Jul 9, 2021 12:24120,5781,146,880,246590,833,79502,195,456