玄关,求助
查看原帖
玄关,求助
947850
yoimiya_op楼主2024/7/11 20:26
#include<bits/stdc++.h>

using namespace std;
priority_queue<int,vector<int>,greater<int> > q;
int n;
int op,x;
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin>>n;
	while(n--){
		cin>>op;
		if(op==1){
			cin>>x;
			q.push(x);
		}else if(op==2){
			cout<<q.top()<<"\n";
			q.pop();
		}else if(op==3){
			q.pop();
		}
	}
	return 0;
}

怎么了这是,为神魔部队

2024/7/11 20:26
加载中...