Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_DEPRECATE
- #include <iostream>
- #include <vector>
- #include <string>
- #include <map>
- #include <stack>
- #include <algorithm>
- using namespace std;
- int a[5001];
- int main() {
- int n;
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> a[i];
- }
- sort(a, a + n);
- if (n % 2 == 0) {
- cout << (double)(a[n / 2] + a[n / 2] - 1) / 2;
- }
- else {
- cout << a[n / 2];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement