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 listDec 9, 2021 08:17Yuriy LyfenkoYuriy LyfenkoScore: 100,234Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 08:1799,743554,336,595488,742,56802,199,552
2Dec 9, 2021 08:1799,749550,616,713488,767,73602,199,552
3Dec 9, 2021 08:1799,779568,311,307488,918,36602,207,744
4Dec 9, 2021 08:17100,148518,730,164489,725,000999,0002,265,088
5Dec 9, 2021 08:17100,158517,957,338488,773,0001,999,0002,342,912
6Dec 9, 2021 08:17100,231513,345,978490,130,0001,000,0002,265,088
7Dec 9, 2021 08:17100,234516,546,165491,146,00002,342,912
8Dec 9, 2021 08:17100,235514,680,474490,151,0001,000,0002,265,088
9Dec 9, 2021 08:17100,236517,788,914490,157,0001,000,0002,334,720
10Dec 9, 2021 08:17100,238513,720,294490,166,0001,000,0002,527,232
11Dec 9, 2021 08:17100,257517,043,993490,258,0001,000,0002,527,232
12Dec 9, 2021 08:17100,321517,887,249491,571,00002,527,232