只过了第一个和测试十二
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
priority_queue<int, vector<int>, greater<int>> q;
int n;
cin >> n;
while (n--) {
int x;
cin >> x;
if (x == 1) {
int y;
cin >> y;
q.push(y);
} else if (x == 2) {
if (!q.empty()) {
cout << q.top() << endl;
q.pop();
}
} else if (x == 3) {
if (!q.empty()) {
q.pop();
}
}
}
return 0;
}