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 15:29Yuriy LyfenkoYuriy LyfenkoScore: 104,317Success
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 15:28103,9721,038,253,471507,466,0001,997,0002,478,080
2Jul 2, 2021 15:29103,9841,037,694,298508,522,000999,0002,478,080
3Jul 2, 2021 15:28103,9891,038,240,855507,548,0001,998,0002,338,816
4Jul 2, 2021 15:29103,9921,037,189,262508,563,000999,0002,478,080
5Jul 2, 2021 15:29104,0501,035,189,334509,846,00002,482,176
6Jul 2, 2021 15:28104,0541,037,766,719508,867,000999,0002,478,080
7Jul 2, 2021 15:28104,0621,031,820,137509,906,00002,482,176
8Jul 2, 2021 15:28104,0761,031,408,789509,971,00002,482,176
9Jul 2, 2021 15:29104,1581,042,605,420509,377,000998,0002,338,816
10Jul 2, 2021 15:28104,1901,044,948,467508,535,0001,998,0002,482,176
11Jul 2, 2021 15:28104,2181,038,096,870510,667,00002,478,080
12Jul 2, 2021 15:28104,2381,034,025,389509,766,000999,0002,342,912
13Jul 2, 2021 15:29104,3171,046,627,764510,156,000998,0002,478,080
14Jul 2, 2021 15:29104,3181,038,255,718509,160,0001,996,0002,482,176
15Jul 2, 2021 15:29104,3221,037,192,660510,180,000998,0002,478,080
16Jul 2, 2021 15:28104,3831,038,109,466509,478,0001,997,0002,478,080
17Jul 2, 2021 15:29104,4021,038,043,089510,573,000999,0002,338,816
18Jul 2, 2021 15:29104,4261,040,138,219510,690,000997,0002,334,720
19Jul 2, 2021 15:29120,2501,142,736,670589,223,92502,211,840
20Jul 2, 2021 15:29120,2731,148,831,421589,339,10702,199,552
21Jul 2, 2021 15:28120,5521,148,815,026590,702,35602,191,360
22Jul 2, 2021 15:28120,5581,158,019,831590,733,77302,191,360
23Jul 2, 2021 15:29120,5681,157,169,855590,782,25702,195,456
24Jul 2, 2021 15:28120,5861,155,681,067590,871,18602,191,360