diff --git a/problem/P3378/P3378.cpp b/problem/P3378/P3378.cpp new file mode 100644 index 00000000..0fc7930f --- /dev/null +++ b/problem/P3378/P3378.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +int main() { + priority_queue, greater > q; + int n; + cin >> n; + while(n--) { + int op; + cin >> op; + if(op == 1) { + int x; + cin >> x; + q.push(x); + } + else if(op == 2) { + cout << q.top() << endl; + } + else if(op == 3) { + q.pop(); + } + } + return 0; +}