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:49Yuriy LyfenkoYuriy LyfenkoScore: 142,950Success
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:49134,4281,229,152,415658,698,35302,232,320
2Jul 2, 2021 06:49134,9191,212,810,972661,101,78602,228,224
3Jul 2, 2021 06:49135,2161,219,365,079662,560,40802,228,224
4Jul 2, 2021 06:49142,5761,222,837,299696,625,0001,998,0002,510,848
5Jul 2, 2021 06:49142,6461,219,505,284697,967,000999,0002,510,848
6Jul 2, 2021 06:49142,8791,228,812,063700,108,00002,387,968
7Jul 2, 2021 06:49142,9501,232,052,803699,455,000999,0002,510,848
8Jul 2, 2021 06:49143,2511,234,222,818701,929,00002,514,944
9Jul 2, 2021 06:49143,4931,224,824,449702,118,0001,000,0002,514,944
10Jul 2, 2021 06:49144,0121,237,278,158703,658,0001,999,0002,510,848
11Jul 2, 2021 06:49144,4821,230,901,168706,962,000999,0002,506,752
12Jul 2, 2021 06:49144,9561,238,161,818709,284,000998,0002,379,776