From 45f053cad9554c8820ac1368d8467615ae0ca77b Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 7 Nov 2020 21:08:59 +0800 Subject: [PATCH] =?UTF-8?q?P1168=20=E4=B8=AD=E4=BD=8D=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R41492477 --- problem/P1168/P1168.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 problem/P1168/P1168.cpp diff --git a/problem/P1168/P1168.cpp b/problem/P1168/P1168.cpp new file mode 100644 index 00000000..c1cac7f4 --- /dev/null +++ b/problem/P1168/P1168.cpp @@ -0,0 +1,17 @@ +#include + +using namespace std; + +int main() { + int n, t; + vector a; + cin >> n; + for (int i = 1; i <= n; i++) { + cin >> t; + a.insert(upper_bound(a.begin(), a.end(), t), t); + if (i % 2) { + cout << a[(i - 1) / 2] << endl; + } + } + return 0; +}