Submission #1032859

#TimeUsernameProblemLanguageResultExecution timeMemory
1032859amine_arouaSure Bet (CEOI17_sure)C++17
20 / 100
50 ms600 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n ; cin>>n; vector<double> a(n) , b(n); int sm1 = 0 , sm2 = 0; for(int i = 0 ; i < n ; i++) { cin>>a[i]>>b[i]; sm1+=a[i] - 2; sm2+=b[i] - 2; } 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)); } printf("%.4lf",(double)ans); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...