Submission #340130

# Submission time Handle Problem Language Result Execution time Memory
340130 2020-12-27T01:35:17 Z israeladewuyi Prosjek (COCI18_prosjek) C++17
50 / 50
1 ms 364 KB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<double> vi;
typedef vector<string> vs;
typedef vector<pair<int,int>> vp;
#define PB push_back
#define pb pop_back
#define in insert 
#define endl "\n"
#define MP make_pair
#define f first
#define Trav(a,x) for(auto& a: x)
const unsigned int M = 1000000007;



int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n; cin>>n; 
	vi v(n);
	Trav(a, v)cin>>a;
	
	sort(v.begin(), v.end());
	
	double mx = 0.000000;
	for(int i = 0; i < n - 1; i++){
		double y = (v[i] + v[i+1])/2;
		mx = max(y, mx);
		v[i+1] = y;
	}
	cout<<setprecision(7)<<mx;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct