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:17Yuriy LyfenkoYuriy LyfenkoScore: 112,108Success
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:17111,6491,069,375,296547,082,00002,523,136
2Jul 9, 2021 12:17111,7481,072,438,189545,568,0001,998,0002,478,080
3Jul 9, 2021 12:17111,7521,075,023,858545,589,0001,998,0002,482,176
4Jul 9, 2021 12:17111,7731,076,720,777545,690,0001,998,0002,478,080
5Jul 9, 2021 12:17111,9491,076,558,594546,552,0001,998,0002,330,624
6Jul 9, 2021 12:17111,9901,075,213,229546,753,0001,999,0002,260,992
7Jul 9, 2021 12:17112,1081,077,267,368548,327,0001,000,0002,482,176
8Jul 9, 2021 12:17112,2081,076,033,622548,821,000999,0002,482,176
9Jul 9, 2021 12:17112,3531,076,929,742549,532,000999,0002,478,080
10Jul 9, 2021 12:17124,0071,191,624,348607,635,61802,191,360
11Jul 9, 2021 12:17124,1031,173,155,817608,105,71902,195,456
12Jul 9, 2021 12:17124,4521,163,089,374609,814,80202,195,456