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 03:32Yuriy LyfenkoYuriy LyfenkoScore: 140,567Success
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 03:32137,2861,200,684,385671,700,000999,0002,510,848
2Jul 2, 2021 03:32137,9421,204,650,196673,919,0001,999,0002,510,848
3Jul 2, 2021 03:32138,1181,203,371,251675,779,000999,0002,506,752
4Jul 2, 2021 03:32139,3331,209,992,441681,735,000999,0002,514,944
5Jul 2, 2021 03:32139,5231,216,209,083680,663,0002,998,0002,510,848
6Jul 2, 2021 03:32140,4731,218,665,366686,318,0001,998,0002,514,944
7Jul 2, 2021 03:32140,5671,216,423,744687,780,000999,0002,371,584
8Jul 2, 2021 03:32141,3611,217,985,245691,668,000999,0002,371,584
9Jul 2, 2021 03:32149,0231,257,121,143729,215,000998,0002,523,136
10Jul 2, 2021 03:32155,1711,319,121,308760,335,94002,228,224
11Jul 2, 2021 03:32156,9431,324,162,091769,019,95602,224,128
12Jul 2, 2021 03:32160,2371,352,804,228785,162,43902,228,224