mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1168 中位数
R41492477
This commit is contained in:
parent
ce30a7194a
commit
45f053cad9
17
problem/P1168/P1168.cpp
Normal file
17
problem/P1168/P1168.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n, t;
|
||||
vector<int> 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user