#include <bits/stdc++.h>
using namespace std;
priority_queue<int,vector<int>,greater<int> > pq;
int main()
{
int n;
cin >> n;
for(int i = 1;i <= n;i++)
{
int op;
cin >> op;
switch(op)
{
case 1:
int x;
cin >> x;
pq.push(x);
break;
case 2:
cout << pq.top() << endl;
break;
case 3:
pq.pop();
break;
}
}
return 0;
}
P3378 【模板】堆
最新推荐文章于 2024-08-31 22:41:09 发布