rt
题面保证序列中数的绝对值小于等于2×109
但是我验证发现很多测试点都超出了这一限制
验证代码
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll testval=2e9;
const int maxn=3e5+5;
ll A[maxn];
int main(){
int n,m;
cin>>n>>m;
ll now=0,maxx=LONG_LONG_MIN,minn=LONG_LONG_MAX,amin=LONG_LONG_MAX,amax=LONG_LONG_MIN;
for(int i=1;i<=n;++i){
cin>>A[i];
amin=min(A[i],amin);
amax=max(A[i],amax);
}
for(int i=0,opt,x,y;i!=m;++i){
cin>>opt;
if(opt==1){
cin>>x;
now+=x;
maxx=max(now,maxx),minn=min(now,minn);
}
else{
cin>>x>>y;
}
}
if((amax+maxx)>testval){
return -1;
}
if((minn+amin)<-testval){
while(1);
}
return 0;
}
结果为4个RE,1个TLE
数据是否出锅,或者对于数据范围的说明错误?