# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1089093 | lucaskojima | Prosjek (COCI18_prosjek) | C++17 | 1099 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const char nl = '\n';
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n; cin >> n;
vector<int> v(n); for (auto &x : v) cin >> x;
sort(all(v));
double ans = 0;
do {
double m;
for (int i = 0; i < n - 1; i++) {
if (i == 0) m = (double) (v[i] + v[i + 1]) / 2;
else m = (double) (m + v[i + 1]) / 2;
}
ans = max(ans, m);
} while (next_permutation(all(v)));
cout << fixed << setprecision(6) << ans << nl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |