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 17:44Yuriy LyfenkoYuriy LyfenkoScore: 100,420Success
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 17:4499,780544,215,356488,921,04902,199,552
2Dec 9, 2021 17:4499,806574,063,279489,047,72402,211,840
3Dec 9, 2021 17:4499,907556,091,965489,546,64102,207,744
4Dec 9, 2021 17:44100,379523,392,931490,859,000999,0002,334,720
5Dec 9, 2021 17:44100,402522,789,251490,971,000999,0002,265,088
6Dec 9, 2021 17:44100,416518,829,311492,036,00002,265,088
7Dec 9, 2021 17:44100,420516,076,117491,057,0001,000,0002,527,232
8Dec 9, 2021 17:44100,421518,479,542492,061,00002,265,088
9Dec 9, 2021 17:44100,453514,500,026492,218,00002,338,816
10Dec 9, 2021 17:44100,486520,116,023492,382,00002,342,912
11Dec 9, 2021 17:44100,500519,708,400492,450,00002,338,816
12Dec 9, 2021 17:44100,534517,644,236491,620,000999,0002,527,232