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 listOct 28, 2021 17:25Yuriy LyfenkoYuriy LyfenkoScore: 108,314Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 28, 2021 17:25107,3881,094,767,051526,201,95102,195,456
2Oct 28, 2021 17:25107,5471,095,371,071526,981,74602,322,432
3Oct 28, 2021 17:25107,5531,079,444,946527,010,67402,195,456
4Oct 28, 2021 17:25108,1851,056,050,764529,107,0001,000,0002,478,080
5Oct 28, 2021 17:25108,2751,056,975,932529,549,000999,0002,482,176
6Oct 28, 2021 17:25108,2831,058,291,544529,589,000999,0002,482,176
7Oct 28, 2021 17:25108,3141,056,552,636528,739,0001,999,0002,482,176
8Oct 28, 2021 17:25108,3671,057,039,247528,999,0001,999,0002,478,080
9Oct 28, 2021 17:25108,3991,057,346,369531,155,00002,478,080
10Oct 28, 2021 17:25108,4711,057,966,127529,512,0001,998,0002,469,888
11Oct 28, 2021 17:25108,5511,057,512,757531,902,00002,482,176
12Oct 28, 2021 17:25108,5641,055,340,779530,964,000999,0002,478,080