IOT Trap什么,请大佬帮忙!(可关一位)
查看原帖
IOT Trap什么,请大佬帮忙!(可关一位)
915822
HappyFlorr楼主2024/8/28 19:06
#include<bits/stdc++.h>
using namespace std;
priority_queue<int,vector<int>,greater<int>> q;
int n;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		int op,x;
		scanf("%d",&op);
		if(op==1){
			scanf("%d",&x);
			q.push(x);
		}else if(op==2){
			printf("%d\n",q.top());
			q.pop();
		}else{
			q.pop();
		}
	}
	return 0;
}

这个代码咋了,Record

2024/8/28 19:06
加载中...