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:51Yuriy LyfenkoYuriy LyfenkoScore: 115,974Success
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:51110,7901,064,659,188541,871,000999,0002,510,848
2Aug 21, 2021 17:51111,9391,081,388,469548,503,00002,510,848
3Aug 21, 2021 17:51112,4741,072,364,842550,124,0001,000,0002,506,752
4Aug 21, 2021 17:51113,3091,082,232,138554,217,000998,0002,506,752
5Aug 21, 2021 17:51113,3571,086,079,043554,448,000999,0002,523,136
6Aug 21, 2021 17:51113,5911,085,853,714554,596,0001,998,0002,506,752
7Aug 21, 2021 17:51115,9741,089,466,181567,271,0001,000,0002,506,752
8Aug 21, 2021 17:51117,4161,111,933,591574,340,0001,000,0002,510,848
9Aug 21, 2021 17:51117,8101,103,970,849576,269,0001,000,0002,510,848
10Aug 21, 2021 17:51126,3641,178,014,750619,182,15002,240,512
11Aug 21, 2021 17:51127,4171,190,149,887624,343,66902,228,224
12Aug 21, 2021 17:51128,4661,190,246,310629,481,02302,228,224