题解 | 【模板】整数优先队列
【模板】整数优先队列
https://www.nowcoder.com/practice/a88e9711f7b04369982bbe8902278ae4
#include <bits/stdc++.h>
#include <queue>
using namespace std;
int main() {
priority_queue<int> pq;
int q,op,x;
cin >> q;
while (q--) {
cin >> op;
if(op == 1)
{
cin >> x;
pq.push(-x);
}
if(op == 2)
{
cout << -pq.top() << endl;
}
if(op == 3)
{
pq.pop();
}
}
}
// 64 位输出请用 printf("%lld")