https://www.luogu.org/problemnew/show/P3378

小知识:优先队列默认数字大的优先级高,即less

#include <cstdio>
#include <queue>
using namespace std;
priority_queue<int,vector<int>,greater<int> > q;
int main(){
    int t,op,num;
    scanf("%d",&t);     
    while(t--){
        scanf("%d",&op);
        if(op==1){
            scanf("%d",&num);
            q.push(num);
        }else if(op==2){
            printf("%d\n",q.top());
        }else if(op==3){
            q.pop();
        }   
    }
    return 0;
}