bool check(int x){
memset(diff,0,sizeof(diff));
for(int i=1;i<=x;i++){
diff[s[i]]+=d[i];
diff[t[i]+1]-=d[i];
}
long long now=0;
for(int i=1;i<=m;i++){
now+=diff[i];
if(now>r[i]){
return 0;
}
}
return 1;
}
RT
check函数里检查每一天是否合法时只循环到了m(应该循环到n)
然而还是水了95分