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:19Yuriy LyfenkoYuriy LyfenkoScore: 147,283Success
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:19139,908718,409,592684,549,000999,0002,375,680
2Jul 2, 2021 02:19140,528713,410,958687,586,000999,0002,383,872
3Jul 2, 2021 02:19141,672716,595,187694,195,00002,265,088
4Jul 2, 2021 02:19144,156732,493,818705,364,000999,0002,265,088
5Jul 2, 2021 02:19144,935736,638,560710,183,00002,527,232
6Jul 2, 2021 02:19147,280747,556,552719,672,0001,999,0002,379,776
7Jul 2, 2021 02:19147,283748,992,887721,687,00002,260,992
8Jul 2, 2021 02:19147,452749,844,272720,516,0001,998,0002,375,680
9Jul 2, 2021 02:19147,523745,545,198721,862,000999,0002,527,232
10Jul 2, 2021 02:19157,924834,717,942773,826,68202,244,608
11Jul 2, 2021 02:19158,705848,988,976777,656,17502,240,512
12Jul 2, 2021 02:19162,497862,772,443796,237,20802,240,512