Submission #1019691

#TimeUsernameProblemLanguageResultExecution timeMemory
1019691overwatch9Sure Bet (CEOI17_sure)C++17
20 / 100
59 ms348 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector <pair <double, double>> nums(n); for (int i = 0; i < n; i++) { double a, b; cin >> a >> b; nums[i].first = a; nums[i].second = b; } double ans = 0; for (int i = 0; i < (1 << (2 * n)); i++) { double l = 0, r = 0; double cnt = __builtin_popcount(i); for (int j = 0; j < 2*n; j++) { if (i & (1 << j)) { if (j % 2 == 0) l += nums[j/2].first; else r += nums[j/2].second; } } ans = max(ans, min(l, r) - cnt); } printf("%.4lf", ans); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...