http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1287 简单的线段树题目,直接写个二分查找大于等于x的最小位置就好了. #include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f #define LL long long ; int A[MAX]; struct SegTree { #define M ((L+R)>>1) #de…
这道题维护一下前缀最大值然后二分答案就好了哇 233 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ,inf=; int read(){ ,f=,c=getchar(); ; c=getchar();} +(c-'); c=getchar();} return ans*f; } int n,m,mx,k,l,r; int a[M],sum[M]; int main(…