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 listAug 21, 2021 17:52Yuriy LyfenkoYuriy LyfenkoScore: 102,029Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 21, 2021 17:52101,9141,028,234,898498,379,000998,0002,478,080
2Aug 21, 2021 17:52101,9571,024,884,224498,592,000999,0002,482,176
3Aug 21, 2021 17:52101,9831,024,991,566497,717,0001,998,0002,334,720
4Aug 21, 2021 17:52101,9961,023,722,068499,778,00002,260,992
5Aug 21, 2021 17:52102,0151,028,919,325498,873,000999,0002,334,720
6Aug 21, 2021 17:52102,0281,026,002,021499,939,00002,523,136
7Aug 21, 2021 17:52102,0291,030,639,232498,944,000999,0002,478,080
8Aug 21, 2021 17:52102,0701,022,767,239500,142,00002,523,136
9Aug 21, 2021 17:52102,0721,025,497,218499,152,0001,000,0002,260,992
10Aug 21, 2021 17:52103,0211,069,505,740504,803,60802,195,456
11Aug 21, 2021 17:52103,1031,065,381,810505,207,01902,203,648
12Aug 21, 2021 17:52103,1111,056,433,481505,242,28302,211,840