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 9, 2021 12:44Yuriy LyfenkoYuriy LyfenkoScore: 101,999Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:48101,9001,033,021,299497,312,0001,997,0002,265,088
2Jul 9, 2021 12:44101,9031,033,703,919498,328,000998,0002,478,080
3Jul 9, 2021 12:45101,9061,025,989,424497,340,0002,001,0002,260,992
4Jul 9, 2021 12:44101,9131,028,644,277499,374,00002,482,176
5Jul 9, 2021 12:44101,9181,029,423,823498,396,0001,000,0002,482,176
6Jul 9, 2021 12:45101,9381,025,473,536498,497,000998,0002,260,992
7Jul 9, 2021 12:48101,9401,026,112,918498,506,000999,0002,478,080
8Jul 9, 2021 12:45101,9451,027,913,183498,533,000999,0002,482,176
9Jul 9, 2021 12:45101,9451,025,943,221497,533,0001,998,0002,482,176
10Jul 9, 2021 12:48101,9461,025,007,835499,535,00002,482,176
11Jul 9, 2021 12:45101,9471,028,226,101499,542,00002,482,176
12Jul 9, 2021 12:45101,9521,027,454,811497,565,0001,998,0002,478,080
13Jul 9, 2021 12:48101,9561,027,265,274498,585,000999,0002,478,080
14Jul 9, 2021 12:44101,9591,030,740,205498,598,000999,0002,482,176
15Jul 9, 2021 12:48101,9721,032,209,901497,663,0001,998,0002,482,176
16Jul 9, 2021 12:44101,9801,032,565,480498,701,000999,0002,482,176
17Jul 9, 2021 12:44101,9861,027,032,281497,733,0001,998,0002,478,080
18Jul 9, 2021 12:44101,9941,026,605,042498,772,000999,0002,478,080
19Jul 9, 2021 12:45101,9991,027,252,319497,794,0001,999,0002,523,136
20Jul 9, 2021 12:48102,0101,027,380,719498,851,000999,0002,338,816
21Jul 9, 2021 12:45102,0141,031,881,545497,872,0001,999,0002,482,176
22Jul 9, 2021 12:44102,0381,031,545,024497,986,0001,999,0002,478,080
23Jul 9, 2021 12:48102,0541,025,442,035499,066,0001,000,0002,523,136
24Jul 9, 2021 12:48102,0601,025,073,179499,092,0001,000,0002,260,992
25Jul 9, 2021 12:44102,0701,021,807,218500,143,00002,478,080
26Jul 9, 2021 12:45102,0961,027,649,034500,270,00002,478,080
27Jul 9, 2021 12:48102,1131,031,616,715499,352,0001,000,0002,342,912
28Jul 9, 2021 12:48103,0681,067,767,680505,034,12502,195,456
29Jul 9, 2021 12:44103,1241,061,106,398505,306,54402,191,360
30Jul 9, 2021 12:44103,1591,074,142,873505,479,60302,322,432
31Jul 9, 2021 12:45103,1611,067,365,105505,489,34602,191,360
32Jul 9, 2021 12:48103,1681,062,849,675505,525,12502,195,456
33Jul 9, 2021 12:45103,1791,064,896,744505,577,43902,195,456
34Jul 9, 2021 12:44103,1951,072,915,869505,655,72302,207,744
35Jul 9, 2021 12:48103,2131,059,357,238505,743,60402,203,648
36Jul 9, 2021 12:45103,2401,065,032,727505,876,75402,191,360