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:53Yuriy LyfenkoYuriy LyfenkoScore: 135,416Success
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:53133,1441,220,101,895652,403,99102,228,224
2Jul 2, 2021 06:53133,2451,211,247,475652,899,48602,232,320
3Jul 2, 2021 06:53133,6101,214,405,081654,689,94302,248,704
4Jul 2, 2021 06:53134,2271,190,993,114656,713,000999,0002,379,776
5Jul 2, 2021 06:53134,2461,181,723,798655,806,0001,999,0002,519,040
6Jul 2, 2021 06:53134,4071,186,333,385657,594,000999,0002,514,944
7Jul 2, 2021 06:53135,4161,189,328,112661,540,0001,998,0002,510,848
8Jul 2, 2021 06:53135,6061,191,520,384662,472,0001,998,0002,510,848
9Jul 2, 2021 06:53135,9781,191,293,918666,293,00002,510,848
10Jul 2, 2021 06:53136,3601,190,719,251667,164,0001,000,0002,510,848
11Jul 2, 2021 06:53136,7261,193,254,579668,958,000999,0002,506,752
12Jul 2, 2021 06:53140,0291,210,727,260685,143,0001,000,0002,510,848