#include <bits/stdc++.h>
#define int long long
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n + 1);
for(int i = 1; i <= n; i++) {
std::cin >> a[i];
}
std::sort(a.begin() + 1, a.end());
int ans = a[1];
for(int i = 2; i <= n; i++) {
ans = (ans + a[i]) / 2;
}
std::cout << ans;
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t = 1;
//std::cin >> t;
while (t--) {
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |