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,236Success
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,701567,337,841488,536,69602,207,744
2Dec 9, 2021 08:1799,759548,044,874488,817,50002,199,552
3Dec 9, 2021 08:17100,189518,629,721490,925,00002,265,088
4Dec 9, 2021 08:17100,201562,949,785490,984,53202,199,552
5Dec 9, 2021 08:17100,229514,110,005491,121,00002,265,088
6Dec 9, 2021 08:17100,231520,026,384491,134,00002,265,088
7Dec 9, 2021 08:17100,236512,720,069489,157,0002,000,0002,342,912
8Dec 9, 2021 08:17100,237518,736,849491,163,00002,527,232
9Dec 9, 2021 08:17100,238515,861,968489,166,0002,000,0002,265,088
10Dec 9, 2021 08:17100,245517,683,525491,201,00002,334,720
11Dec 9, 2021 08:17100,247514,263,636491,211,00002,527,232
12Dec 9, 2021 08:17100,250511,987,824490,226,0001,000,0002,265,088