# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
620086 | 2022-08-02T22:31:55 Z | mmk | Prosjek (COCI18_prosjek) | C++14 | 1 ms | 304 KB |
#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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 304 KB | Output is correct |
4 | Correct | 1 ms | 304 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 212 KB | Output is correct |