题解 1439: 蓝桥杯历届试题-小朋友排队

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

参考c语言写的

摘要:def add(d, i, x, maxh):     while i <= maxh + 1:         d[i] += x         i += i

树状数组,python

解题思路:注意事项:参考代码:n=int(input())h=list(map(int,input().split()))maxh=max(h)cnt=[0]*(n)c=[0]*(maxh+2)#c[i]代表的是身高i-1deflowbit(i):returni&(-i)defupdate(i,