[UVa1451]Average 算法竞赛入门经典第8章8-9 ( P243 ) 题目大意:给定一个长度为N的01串,选择一个长度至少为L的连续子串,使序列平均值最大 (N<=100001) 题目分析:预处理前缀和的方法是O(N^2)的时间复杂度. 那么,设x轴表示下标,y轴表示1的个数,那么连接两个点,构成一条线段. 对于一条平行于y轴的线,显然,在某些区间内,对于这样的三个点,我们考虑中间那个点的价值: 假设取A区间的一个点,那么显然,最上面的点与选出的点的斜率最大. 取B区间的一个点,那么…