佳佳的手账

(a[i+1]+a[i+2]+......+a[i+x])/x<=k

(a[i+1]-k)+(a[i+2]-k)+......(a[i+x]-k)<=0

b[i+1]=a[i+1]-k

s[i]=b[1]+b[2]+......+b[i]

统计:j<i s[j]>s[i]

用树状数组维护  O(nlogn)

这种想法以前接触过,忘记......

原文地址:https://www.cnblogs.com/lcan/p/9554227.html