Submission #46426

#TimeUsernameProblemLanguageResultExecution timeMemory
46426Yedyge2004Sure 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 int long long #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 a[N],b[N],n; int cnt; void rec( int pos = 1 , int x = 0 , int y = 0 , int 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); } main(){ cin >> n; for ( int i = 1 ; i <= n ; ++i ){ cin >> a[i] >> b[i]; } rec(); cout << fixed << setprecision(4) << (double)cnt << endl; ioi }

Compilation message (stderr)

sure.cpp:37:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...