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,211Success
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,5381,068,932,048539,640,0001,998,0002,510,848
2Aug 21, 2021 17:51111,7721,074,597,060545,685,0001,998,0002,506,752
3Aug 21, 2021 17:51111,8291,077,359,249546,962,000999,0002,506,752
4Aug 21, 2021 17:51112,2211,081,362,879548,886,000999,0002,510,848
5Aug 21, 2021 17:51113,2631,087,840,964552,991,0001,999,0002,379,776
6Aug 21, 2021 17:51114,3871,089,152,924559,498,000999,0002,510,848
7Aug 21, 2021 17:51115,2111,092,220,486563,533,000999,0002,506,752
8Aug 21, 2021 17:51115,7821,092,233,439566,333,0001,000,0002,375,680
9Aug 21, 2021 17:51116,0391,096,834,699566,592,0001,998,0002,510,848
10Aug 21, 2021 17:51126,9061,173,145,019621,841,09202,240,512
11Aug 21, 2021 17:51127,4411,186,097,980624,463,01102,224,128
12Aug 21, 2021 17:51128,2061,207,699,336628,207,19902,228,224