Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 667 Bytes

1125.md

File metadata and controls

43 lines (33 loc) · 667 Bytes

1125

image.png

#include <cstdio>
#include <algorithm>
#include <vector>
// #include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	scanf("%d", &N);
	vector<int> v(N);
	for (int n = 0; n < N; n++) {
		scanf("%d", &v[n]);
	}
	sort(v.begin(), v.end());
	for (int i = 1; i < N; i++) {
		v[i] = (v[i] + v[i - 1]) / 2;
		// printf("%f\n", arr[i]);
	}
	printf("%d\n", v[N - 1]);
	return 0;
}

/*
Sample Input:
8
10 15 12 3 4 13 1 15
Sample Output:
14
*/

References