/*
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
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
256 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
256 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
256 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |