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:34Yuriy LyfenkoYuriy LyfenkoScore: 102,026Success
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:34101,8681,019,235,585498,154,0001,000,0002,482,176
2Oct 28, 2021 17:34101,9021,027,287,728497,323,0001,997,0002,342,912
3Oct 28, 2021 17:34101,9041,027,369,448499,330,00002,338,816
4Oct 28, 2021 17:34101,9191,028,003,274498,407,000998,0002,478,080
5Oct 28, 2021 17:34101,9491,031,462,877497,553,0001,998,0002,478,080
6Oct 28, 2021 17:34101,9721,026,947,268497,663,0001,998,0002,482,176
7Oct 28, 2021 17:34102,0261,025,230,954498,926,000999,0002,478,080
8Oct 28, 2021 17:34102,0601,025,024,875499,095,0001,000,0002,482,176
9Oct 28, 2021 17:34102,0751,026,039,918499,167,0001,000,0002,478,080
10Oct 28, 2021 17:34103,0811,070,869,097505,096,08502,318,336
11Oct 28, 2021 17:34103,1551,066,353,919505,458,12702,195,456
12Oct 28, 2021 17:34103,1681,077,413,911505,524,98002,195,456