| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1327556 | kawhiet | Sure Bet (CEOI17_sure) | C++20 | 49 ms | 420 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<double> a(n), b(n);
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
double ans = 0;
for (int s = 0; s < (1 << n); s++) {
for (int t = 0; t < (1 << n); t++) {
double x = 0, y = 0;
int cnt = 0;
for (int i = 0; i < n; i++) {
if (s & (1 << i)) {
cnt++;
x += a[i];
}
if (t & (1 << i)) {
cnt++;
y += b[i];
}
}
ans = max(ans, min(x, y) - cnt);
}
}
cout << fixed << setprecision(4) << ans << '\n';
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
