我的看看
2025-08-20 21:54:29
发布于:浙江
3阅读
0回复
0点赞
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e8+5;
ll n,m;
int a[100005];
int q[100005];
int main(){
cin>>n;
int s=0,r=0,l=0;
for(int i=0;i<n;i++){
int b,c,d;
cin>>b>>c>>d;
if(b==0){
a[r]=c;
q[r]=d;
r++;
s+=c;
}else{
while(l<r&&d-q[l]>45){
l++;
}
int f=1;
for(int i=l;i<r;i++){
if(a[i]&&a[i]>=c){
f=0;
a[i]=0;
break;
}
}
if(f)s+=c;
}
}
cout<<s<<'\n';
return 0;
}
这里空空如也
有帮助,赞一个