Submission #49826

# Submission time Handle Problem Language Result Execution time Memory
49826 2018-06-03T11:23:56 Z A_H_Ghaznavi Prosjek (COCI18_prosjek) C++14
50 / 50
3 ms 812 KB
// In the name of god
// A.H.Ghaznavi
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int n,a[30];
ld ans[30];
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n;
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort (a, a+n);
    for (int i=0;i<n;i++)
        ans[i]=a[i];
    for (int i=0;i<n-1;i++)
        ans[i+1]=(ans[i]+ans[i+1])/2;
    cout.precision(10);
    cout<<fixed<<ans[n-1];
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 3 ms 360 KB Output is correct
3 Correct 2 ms 472 KB Output is correct
4 Correct 3 ms 712 KB Output is correct
5 Correct 3 ms 812 KB Output is correct
6 Correct 2 ms 812 KB Output is correct
7 Correct 3 ms 812 KB Output is correct
8 Correct 2 ms 812 KB Output is correct
9 Correct 2 ms 812 KB Output is correct
10 Correct 3 ms 812 KB Output is correct