# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
51378 | adamczh1 | Sure Bet (CEOI17_sure) | C++17 | 77 ms | 744 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n;
double a[MAXN], b[MAXN];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lf %lf", &a[i], &b[i]);
}
double res = 0;
for (int mask = 0; mask < (1 << (2 * n)); mask++) {
double x = 0, y = 0;
for (int i = 0; i < n; i++) {
if ((mask >> (2 * i)) & 1) {
x += a[i] - 1;
y--;
}
if ((mask >> (2 * i + 1)) & 1) {
x--;
y += b[i] - 1;
}
}
res = max(res, min(x, y));
}
printf("%.4lf", res);
return 0;
}
Compilation message (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... |