結果

問題 No.710 チーム戦
ユーザー rapurasurapurasu
提出日時 2018-07-13 09:48:37
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 718 bytes
コンパイル時間 1,719 ms
コンパイル使用メモリ 162,696 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-16 11:06:50
合計ジャッジ時間 2,751 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
int A[101];
int B[101];
int dp[100011];
int pre[100011];
int main(){
	cin>>N;
	int s=0;
	REP(i,N){
		cin>>A[i]>>B[i];
		s+=B[i];
	}
	REP(i,100011){
		dp[i]=s;
	}
	REP(i,N){
		REP(j,100011){
			pre[j]=dp[j];
		}
		REP(j,10011){
			if(j+A[i]<100001){
				dp[j+A[i]]=min(dp[j+A[i]],pre[j]-B[i]);
			}
		}
		/*REP(j,101){
			cout<<dp[j]<<endl;
		}
		cout<<"end"<<endl;*/
	}
	
	int ans=1e7;
	REP(i,10011){
		ans=min(ans,max(dp[i],i));
	}
	cout<<ans<<endl;
	return(0);
}
0