답안 #46429

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
46429 2018-04-20T15:35:37 Z Yedyge2004 Sure Bet (CEOI17_sure) C++14
0 / 100
2 ms 256 KB
/*
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 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);
}

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

sure.cpp:38:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
# 결과 실행 시간 메모리 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 -