Submission #46430

#TimeUsernameProblemLanguageResultExecution timeMemory
46430Yedyge2004Sure Bet (CEOI17_sure)C++14
0 / 100
2 ms256 KiB
/* coded by : Bissultanov Yedyge; :) */ #include <bits/stdc++.h> #define ioi return 0; #define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define sz size() #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front const int N = 1e7; using namespace std; int n; double a[N],b[N]; double cnt; void rec( int pos = 1 , double x = 0 , double y = 0 , double total = 0 ){ if ( pos > n ){ cnt = max(cnt , (min(x,y)-total)); return; } rec(pos+1,x,y,total); rec(pos+1,x+a[pos],y,total+1); rec(pos+1,x,y+b[pos],total+1); rec(pos+1,x+a[pos],y+b[pos],total+2); } int main(){ cin >> n; for ( int i = 1 ; i <= n ; ++i ){ cin >> a[i] >> b[i]; } rec(); cout << fixed << setprecision(4) << (double)cnt << endl; ioi }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...