求逆序数.1(2k)2(2k-1)...(k-1)(k+2)k(k+1)
问题描述:
求逆序数.1(2k)2(2k-1)...(k-1)(k+2)k(k+1)
答
逆序数=2k-2+(2k-4)+(2k-6)+.+2
=2(1+2+...+(k-1))
=2×(1+k-1)×(k-1)÷2
=k(k-1)