#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll int a,p,t,ans = 0,e = 0;
bool b;
int c[2][100000005];
bool d[100000005];
int main(){
cin>>a;
for(int i = 1;i <= a;i++){
cin>>b>>p>>t;
if(b){
ans = ans + p;
for(int i = 0;i <= 44;i++){
if(c[1][i] >= p && t - c[2][i] <= 45 && t - c[2][i] >= 0 && d){
ans = ans - p;
d[i] = 0;
break;
}
}
}else{
ans += p;
e++;
c[1][e - 1] = p;
c[2][e - 1] = t;
d[e - 1] = true;
}
}
cout<<ans;
return 0;
}
为什么全过不了?