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:27Yuriy LyfenkoYuriy LyfenkoScore: 102,210Success
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:27102,1181,026,649,235499,381,000998,0002,482,176
2Oct 28, 2021 17:27102,1511,027,992,581499,540,0001,001,0002,478,080
3Oct 28, 2021 17:27102,1571,026,723,793498,572,0001,998,0002,334,720
4Oct 28, 2021 17:27102,1921,028,351,093498,745,0001,998,0002,486,272
5Oct 28, 2021 17:27102,1961,024,452,665499,761,000999,0002,478,080
6Oct 28, 2021 17:27102,2091,026,716,540498,824,0001,999,0002,482,176
7Oct 28, 2021 17:27102,2101,023,371,172498,831,0001,999,0002,482,176
8Oct 28, 2021 17:27102,2131,024,377,037499,844,000999,0002,478,080
9Oct 28, 2021 17:27102,2301,027,026,406499,928,000999,0002,482,176
10Oct 28, 2021 17:27103,1861,071,885,854505,610,90102,191,360
11Oct 28, 2021 17:27103,2911,068,483,738506,127,27502,195,456
12Oct 28, 2021 17:27103,3091,074,123,533506,214,51702,191,360