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 listJul 2, 2021 06:51Yuriy LyfenkoYuriy LyfenkoScore: 135,570Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 06:51131,8741,204,135,009646,183,02802,236,416
2Jul 2, 2021 06:51131,9421,212,322,300646,517,43202,236,416
3Jul 2, 2021 06:51134,3991,187,461,488657,555,000999,0002,510,848
4Jul 2, 2021 06:51134,5931,189,222,606657,510,0001,998,0002,519,040
5Jul 2, 2021 06:51135,4041,196,917,755662,482,000999,0002,506,752
6Jul 2, 2021 06:51135,5421,185,607,169664,157,00002,510,848
7Jul 2, 2021 06:51135,5701,189,566,573663,293,0001,000,0002,506,752
8Jul 2, 2021 06:51135,7311,192,403,422664,081,0001,000,0002,383,872
9Jul 2, 2021 06:51136,4511,237,836,017668,608,42802,228,224
10Jul 2, 2021 06:51136,9381,196,288,631670,994,00002,379,776
11Jul 2, 2021 06:51138,0121,204,014,732676,260,00002,510,848
12Jul 2, 2021 06:51140,9421,222,865,445688,620,0001,998,0002,383,872