题目:传送门
我的代码:
#include<bits/stdc++.h>
using namespace std;
int n;
priority_queue<int,vector<int>,greater<int> >heap;
int main()
{
scanf("%d",&n);
for(/*register*/ int op,i=1;i<=n;i++){
scanf("%d",&op);
switch (op) {
case 1:
int x;
scanf("%d",&x);
heap.push(x);
case 2:
printf("%d\n",heap.top());
case 3:
heap.pop();
}/*
if(op=='1') {
int x;
scanf("%d",&x);heap.push(x);
}else if(op=='2'){
printf("%d\n",heap.top());
}else heap.pop(); */
}
return 0;
}