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; +}