Submission #1032856

#TimeUsernameProblemLanguageResultExecution timeMemory
1032856amine_arouaSure Bet (CEOI17_sure)C++17
0 / 100
0 ms344 KiB
#include<bits/stdc++.h> using namespace std; int main() { 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 mask = 0 ; mask < (1<<(2 * n)) ; mask++) { double f = 0 , s = 0; for(int i = 0 ; i < n ; i++) { int bit = (mask >> (2*i)) - 4 * (mask >> (2*(i + 1))); if(bit == 0) { continue; } else if(bit == 1) { f+=a[i] - 1; s--; } else if(bit == 2) { f--; s+=b[i] - 1; } else { f+=a[i] - 2; s+=b[i] - 2; } } ans = max(ans , min(f , s)); } cout<<ans<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...