其他分享
首页 > 其他分享> > bbb

bbb

作者:互联网

bool check(int mid){
  int sum=0,sumL=0;
  for(int i=1;i<=L;i++) sum += a[i] = mid;
  int MaxSum = -inf ,MinSum=inf;
  for(int i=L;i<=n;i++){
    MaxSum = max(MaxSum,sum-MinSum);
    sum += a[i+1]-mid;
    MinSum = min(MinSum,sumL);
  }
  return MaxSum >= 0;
}

 

标签:sumL,int,sum,mid,bbb,MinSum,MaxSum
来源: https://www.cnblogs.com/xht-blog/p/15111394.html