forked from ndb796/python-for-coding-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.cpp
More file actions
20 lines (15 loc) · 303 Bytes
/
2.cpp
File metadata and controls
20 lines (15 loc) · 303 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v;
int main(void) {
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
v.push_back(x);
}
sort(v.begin(), v.end());
// 중간값(median)을 출력
cout << v[(n - 1) / 2] << '\n';
}