結果

問題 No.710 チーム戦
ユーザー aaaaaa
提出日時 2018-07-22 21:03:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 891 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 91,440 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-08-27 01:00:01
合計ジャッジ時間 6,213 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>

using namespace std;
int n, a[100], b[100], minn = 99999999;

int func(int suma, int sumb, int cnt ) {

	if (cnt + 1 == n) {
		//cout << "suma->" << suma << " sumb->" << sumb << " cnt->" << cnt << endl;
		suma = max(suma, sumb);
		minn = min(minn, suma);

		return 0;
	}
	

	func(suma + a[cnt+ 1], sumb, cnt+1);
	func(suma, sumb + b[cnt + 1], cnt+1);





	return 0;
}

int main() {
	int i, j, k;
	

	cin >> n;

	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
	}


	func(a[0], 0, 0);
	func(0, b[0], 0);


	//cout << "minn->" << minn << endl;
	cout << minn << endl;










	getchar();
	getchar();
	return 0;
}
0