toj4168 I-The brute force problem
toj4168若当前能覆盖的区间为[1,x],加上一个元素y后能覆盖的区间变为[1,x],[y],[1+y,x+y]
要保证y<=x+1才不会有空缺,详见代码#include<bits/stdc++.h>
using namespace std;
#define N 100005
long long a[N],ans,now;
int main()
{
int t,n,m,i;
s
原创
2017-07-16 21:07:44 ·
259 阅读 ·
0 评论