#include <bits/stdc++.h>
using namespace std;
int n, x;
multiset<int> s;
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i=0;i<n;i++){
cin >> x;
s.insert(x);
}
set<int> :: iterator it = s.begin();
double a = *it;
for (int i=0;i<n;i++){
a = (a + *it)/2;
it++;
}
cout << a;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
380 KB |
Output is correct |
2 |
Correct |
2 ms |
472 KB |
Output is correct |
3 |
Correct |
2 ms |
472 KB |
Output is correct |
4 |
Correct |
2 ms |
476 KB |
Output is correct |
5 |
Correct |
2 ms |
476 KB |
Output is correct |
6 |
Correct |
2 ms |
588 KB |
Output is correct |
7 |
Correct |
2 ms |
588 KB |
Output is correct |
8 |
Correct |
2 ms |
588 KB |
Output is correct |
9 |
Correct |
2 ms |
588 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |