| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 56080 | gabrielsimoes | Sure Bet (CEOI17_sure) | C++17 | 2 ms | 356 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5+10;
int n;
double pa[MAXN], pb[MAXN];
double ans = 0;
void dfs(int i, double a, double b) {
if (i == n) {
ans = max(ans, min(a, b));
} else {
dfs(i+1, a, b);
dfs(i+1, a-1.0, b+pb[i]-1.0);
dfs(i+1, a+pa[i]-1.0, b-1.0);
}
}
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
double a, b;
scanf("%lf %lf", &a, &b);
// pa[i] = 1e4 * a;
// pb[i] = 1e4 * b;
pa[i] = a;
pb[i] = b;
}
dfs(0, 0, 0);
printf("%.4lf\n", ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
