답안 #164401

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
164401 2019-11-20T11:57:38 Z crushteacherswife Prosjek (COCI18_prosjek) C++14
50 / 50
3 ms 504 KB
//Rochy'.'
#include <bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define fl(i,a,b) for(int i=a;i<b;++i)
#define fa(i,a) for(auto i:a)
#define ii pair <long long,int>
#define vi vector <int>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
using namespace std;
template <typename T> inline void read(T &x){char c;bool nega=0;while((!isdigit(c=getchar()))&&(c!='-'));
if(c=='-'){nega=1;c=getchar();}x=c-48;while(isdigit(c=getchar()))x=x*10+c-48;if(nega)x=-x;}
template <typename T> inline void writep(T x){if(x>9)writep(x/10);putchar(x%10+48);}
template <typename T> inline void write(T x){if(x<0){putchar('-');x=-x;}writep(x);putchar(' ');}
template <typename T> inline void writeln(T x){write(x);putchar('\n');}
template <typename R, typename D> inline void Min(R &a, D b){if(a>b) a=b;}
template <typename D, typename R> inline void Max(D &a, R b){if(a<b) a=b;}
const int N=102;
int n,a[N];
int main(){
    ios_base::sync_with_stdio(NULL);
    cin. tie(NULL); cout. tie(NULL);
//    freopen(".inp" , "r", stdin);
//    freopen(".out", "w", stdout);
	cin>>n;
	fo(i,1,n) cin>>a[i];
	sort(a+1,a+1+n);
	double cur=a[1];
	fo(i,2,n){
		cur=(cur+a[i])/2;
	}
	cout<<setprecision(6)<<fixed<<cur;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 504 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 252 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 416 KB Output is correct