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 02:22Yuriy LyfenkoYuriy LyfenkoScore: 141,370Success
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 02:22136,8901,196,453,368668,763,0001,999,0002,260,992
2Jul 2, 2021 02:22137,0511,199,190,594670,551,000999,0002,510,848
3Jul 2, 2021 02:22137,9331,203,873,588674,873,000999,0002,506,752
4Jul 2, 2021 02:22139,9181,210,917,522683,600,0001,998,0002,510,848
5Jul 2, 2021 02:22140,0031,214,015,315686,013,00002,514,944
6Jul 2, 2021 02:22140,4741,214,780,433686,325,0001,998,0002,510,848
7Jul 2, 2021 02:22141,3701,218,401,847691,715,000999,0002,375,680
8Jul 2, 2021 02:22145,1721,235,405,786710,343,000999,0002,260,992
9Jul 2, 2021 02:22147,7691,247,803,095723,066,0001,000,0002,510,848
10Jul 2, 2021 02:22156,0271,319,025,149764,530,30202,240,512
11Jul 2, 2021 02:22156,6521,347,635,587767,596,48402,232,320
12Jul 2, 2021 02:22161,5081,352,691,902791,390,97802,228,224