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:50Yuriy LyfenkoYuriy LyfenkoScore: 142,962Success
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:50123,7791,160,567,099606,515,21802,236,416
2Aug 21, 2021 17:50126,2841,186,075,665618,793,94902,256,896
3Aug 21, 2021 17:50130,3961,203,842,685638,940,90002,256,896
4Aug 21, 2021 17:50142,2231,223,630,660695,893,0001,001,0002,527,232
5Aug 21, 2021 17:50142,4041,222,055,337695,780,0002,002,0002,281,472
6Aug 21, 2021 17:50142,8561,223,722,027697,993,0001,999,0002,527,232
7Aug 21, 2021 17:50142,9621,224,089,473698,513,0002,001,0002,527,232
8Aug 21, 2021 17:50143,0201,221,911,176698,796,0002,002,0002,269,184
9Aug 21, 2021 17:50143,0941,225,163,931700,159,0001,001,0002,265,088
10Aug 21, 2021 17:50144,7231,233,196,177708,141,0001,000,0002,281,472
11Aug 21, 2021 17:50146,4761,242,396,619714,732,0002,998,0002,523,136
12Aug 21, 2021 17:50147,0671,247,294,215718,627,0002,001,0002,281,472