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:23Yuriy LyfenkoYuriy LyfenkoScore: 109,633Success
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:23108,6411,106,585,796532,341,81202,211,840
2Oct 28, 2021 17:23108,8851,096,252,025533,538,89502,203,648
3Oct 28, 2021 17:23109,1951,108,989,750535,056,92602,191,360
4Oct 28, 2021 17:23109,5611,066,658,200535,852,000999,0002,482,176
5Oct 28, 2021 17:23109,5731,063,922,383535,908,000999,0002,478,080
6Oct 28, 2021 17:23109,5861,060,577,343534,973,0001,999,0002,482,176
7Oct 28, 2021 17:23109,6331,067,085,935535,205,0001,997,0002,342,912
8Oct 28, 2021 17:23109,8361,072,077,609537,198,000998,0002,523,136
9Oct 28, 2021 17:23109,8891,067,620,421537,460,000998,0002,338,816
10Oct 28, 2021 17:23109,9071,064,951,046537,547,000999,0002,478,080
11Oct 28, 2021 17:23110,0221,063,656,120539,109,00002,523,136
12Oct 28, 2021 17:23110,0401,062,756,861537,197,0001,997,0002,478,080