# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
872554 | 2023-11-13T11:10:06 Z | vjudge1 | Sure Bet (CEOI17_sure) | C++17 | 0 ms | 348 KB |
//author: Ahmet Alp Orakci #include <bits/stdc++.h> using namespace std; using i64 = long long; #define d64 double #define ONLINE_JUDGE void solve() { int n; scanf("%d", &n); pair <d64, d64> arr[n]; for(auto &[a, b] : arr) { scanf("%lf %lf", &a, &b); } d64 ans = -1E9; for(int mask = 0; mask < (1 << n); mask++) { for(int mmask = 0; mmask < (1 << n); mmask++) { d64 fir = 0, sec = 0; for(int i = 0; i < n; i++) { if(mask & (1 << i)) { if(mmask & (1 << i)) fir += arr[i].first; else sec += arr[i].second; } } ans = max(ans, min(fir, sec) - __builtin_popcount(mask)); } } printf("%4lf", double(ans)); return; } signed main() { #ifndef ONLINE_JUDGE freopen(".in", "r", stdin); freopen(".out", "w", stdout); #endif int t = 1; //cin >> t; for(int i = 1; i <= t; i++) { solve(); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |