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:40Yuriy LyfenkoYuriy LyfenkoScore: 104,091Success
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:40103,9621,040,170,289509,412,00002,478,080
2Jul 9, 2021 12:40103,9641,036,913,307507,427,0001,997,0002,478,080
3Jul 9, 2021 12:40104,0501,036,781,839509,844,00002,482,176
4Jul 9, 2021 12:40104,0561,036,380,412507,873,0001,999,0002,342,912
5Jul 9, 2021 12:40104,0561,037,239,412508,876,000999,0002,478,080
6Jul 9, 2021 12:40104,0631,035,723,486507,912,0001,999,0002,523,136
7Jul 9, 2021 12:40104,0911,032,449,983510,044,00002,260,992
8Jul 9, 2021 12:40104,1221,035,527,107509,202,000998,0002,482,176
9Jul 9, 2021 12:40104,2431,035,671,381508,790,0001,999,0002,482,176
10Jul 9, 2021 12:40104,3271,075,448,015511,203,76402,195,456
11Jul 9, 2021 12:40104,4021,074,657,596511,568,12102,195,456
12Jul 9, 2021 12:40104,4311,093,818,594511,711,74702,191,360