# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
620086 | mmk | Prosjek (COCI18_prosjek) | C++14 | 1 ms | 304 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;
vector<double> v;
bool cmp(double a, double b)
{
return a>b;
}
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
double aux;
scanf("%lf",&aux);
v.push_back(aux);
}
while(v.size()!=1)
{
sort(v.begin(),v.end(),cmp);
double aux=0;
aux+=v.back();
v.pop_back();
aux+=v.back();
v.pop_back();
aux=aux/2;
//printf("%lf\n",aux);
v.push_back(aux);
}
printf("%.6lf",v[0]);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |