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 20, 2022 15:16Yuriy LyfenkoYuriy LyfenkoScore: 100,189Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 15:1699,809539,949,669489,064,40502,199,552
2Jul 20, 2022 15:16100,111518,842,581488,546,0001,998,0002,342,912
3Jul 20, 2022 15:16100,152516,409,943489,746,000999,0002,338,816
4Jul 20, 2022 15:16100,159517,855,062488,780,0001,999,0002,338,816
5Jul 20, 2022 15:16100,178517,189,617489,874,000999,0002,342,912
6Jul 20, 2022 15:16100,186516,967,859488,910,0001,999,0002,338,816
7Jul 20, 2022 15:16100,189521,126,740489,925,000999,0002,342,912
8Jul 20, 2022 15:16100,212518,714,412489,038,0002,000,0002,265,088
9Jul 20, 2022 15:16100,233557,701,430491,139,95302,199,552
10Jul 20, 2022 15:16100,265517,223,310491,297,00002,338,816
11Jul 20, 2022 15:16100,343568,040,453491,681,52202,211,840
12Jul 20, 2022 15:16100,978520,931,293493,793,000999,0002,256,896