题目 单调队列+前缀和 #include <bits/stdc++.h> #define N 101001 using namespace std; int n, s, t; int data[N]; double ans, temp[N], sum[N], l = -10000, r = 10000; bool check(double a) { deque <int> q; memset(sum, 0, sizeof(sum)); for (int i = 1; i <=…
空题段长度即为单调队列长度区间 每次二分答案进行check即可 #include<bits/stdc++.h> using namespace std; ; const int inf=0x3f3f3f3f; int n,t,l,r,mid,ans; int a[N],q[N],f[N]; int head,tail; bool check(int mid){ memset(f,,sizeof f); memset(q,,sizeof q); head=tail=; ;i<=n;i++)…