只能过样例1,求调
查看原帖
只能过样例1,求调
1270880
yuanlang楼主2025/7/2 10:26
#include<bits/stdc++.h>
using namespace std;
struct ava{
	bool x=true;
	int p,t;
};
int main(){
	int n;
	cin>>n;
	ava a[n];
	int s=0,r=0;
	while(n--){
		int v,p,t;
		cin>>v>>p>>t;
		if(v==0){
			s+=p;
			a[r].p=p;
			a[r].t=t;
		}else{
			bool u=true;
			for(int i=0;i<=r;i++){
				if(t-a[i].t>=45)a[i].x=false;
				if(a[i].x&&a[i].p>=p){
					a[i].x=false;
					u=false;
					break;
				}
			}
			if(u)s+=p;
		}
	}
	cout<<s; 
	return 0;
}
2025/7/2 10:26
加载中...