# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
604123 | 2022-07-24T18:39:22 Z | hyakup | Prosjek (COCI18_prosjek) | C++17 | 1 ms | 212 KB |
#include <bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d", &n); multiset<double> s; for( int i = 0; i < n; i++){ double g; scanf("%lf", &g); s.insert(g); } multiset<double>::iterator it, it2; while( s.size() > 1 ){ it = s.begin(); it++; it2 = it; it--; s.insert(( *it + *it2 )/2 ); s.erase(it); s.erase(it2); } printf("%f", *(s.begin()) ); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 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 | 1 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 212 KB | Output is correct |