0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 14:38:48 +00:00
OI-codes/Luogu/P3378/P3378.cpp

24 lines
431 B
C++
Raw Normal View History

2021-11-19 09:01:13 +00:00
#include <bits/stdc++.h>
2020-11-02 09:05:29 +00:00
using namespace std;
int main() {
priority_queue<int, vector<int>, greater<int> > q;
int n;
cin >> n;
2021-11-19 09:01:13 +00:00
while (n--) {
2020-11-02 09:05:29 +00:00
int op;
cin >> op;
2021-11-19 09:01:13 +00:00
if (op == 1) {
2020-11-02 09:05:29 +00:00
int x;
cin >> x;
q.push(x);
2021-11-19 09:01:13 +00:00
} else if (op == 2) {
2020-11-02 09:05:29 +00:00
cout << q.top() << endl;
2021-11-19 09:01:13 +00:00
} else if (op == 3) {
2020-11-02 09:05:29 +00:00
q.pop();
}
}
return 0;
}