希望大佬能宽容得指导本蒟蒻
#include<iostream>
using namespace std;
int n;
struct yh{
int id,time,price;
}a[100005];
int d,price,time;
int id=-1;
int sum;
bool f=0;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>d>>price>>time;
if(d==1){
id+=1;
sum+=price;
a[id].price=price;
a[id].time=time+45;
a[id].id=1;
}else{
for(int i=0;i<id;i++){
if(a[i].price>=price&&a[i].time>=time&&a[i].id==1){
a[i].id=0;
f=1;
break;
}
}
if(!f){
sum+=price;
f=0;
}
}
}
cout<<sum;
return 0;
}
```希望大佬能尽可能地按照我的代码修改