# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
340130 | israeladewuyi | Prosjek (COCI18_prosjek) | C++17 | 1 ms | 364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |