tj
2025-10-12 09:39:31
发布于:广东
1阅读
0回复
0点赞
#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<queue>
#include<cmath>
#define ll long long
#define si short int
#define INF 0xffffff
using namespace std;
ll n,ans;
ll head;
struct node {
ll score;
ll time;
};
vector<node> ydt;
int main() {
cin>>n;
for(ll i=0;i<n;i++) {
bool type;
ll score,time;
cin>>type>>score>>time;
ans+=score;
if(type) {
while(time-ydt[head].time>45 && head<ydt.size()) {
head++;
}
for(ll i=head;i<ydt.size();i++) {
if(ydt[i].score >= score) {
// cout<<"debug: "<<score<<"\n";
ans-=score;
ydt[i].score = -INF;
break;
}
}
}
else {
ydt.push_back({score,time});
}
}
cout<<ans;
}
这里空空如也




有帮助,赞一个