From d2df3fd8d9d9f44e47cdbcf049971869c5dea635 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Mon, 2 Nov 2020 17:05:29 +0800 Subject: [PATCH] =?UTF-8?q?P3378=20=E3=80=90=E6=A8=A1=E6=9D=BF=E3=80=91?= =?UTF-8?q?=E5=A0=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R41079850 --- problem/P3378/P3378.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 problem/P3378/P3378.cpp 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; +}