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:15Yuriy LyfenkoYuriy LyfenkoScore: 110,978Success
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:15110,6141,065,559,202540,011,0002,000,0002,473,984
2Jul 9, 2021 12:15110,6221,069,416,665542,050,00002,478,080
3Jul 9, 2021 12:15110,6521,072,723,330542,195,00002,478,080
4Jul 9, 2021 12:15110,6721,074,714,656540,295,0001,997,0002,342,912
5Jul 9, 2021 12:15110,9271,073,732,306541,542,0001,998,0002,523,136
6Jul 9, 2021 12:15110,9731,070,070,511541,770,0001,999,0002,482,176
7Jul 9, 2021 12:15110,9781,067,571,164543,794,00002,342,912
8Jul 9, 2021 12:15110,9941,067,874,573542,873,000999,0002,338,816
9Jul 9, 2021 12:15111,0031,070,476,807542,916,000999,0002,260,992
10Jul 9, 2021 12:15122,5351,171,490,527600,420,60902,191,360
11Jul 9, 2021 12:15122,7171,159,513,152601,313,52302,191,360
12Jul 9, 2021 12:15122,8571,164,205,506601,998,60202,199,552