結果

問題 No.710 チーム戦
ユーザー furafura
提出日時 2020-07-11 23:29:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 64 ms / 3,000 ms
コード長 452 bytes
コンパイル時間 2,404 ms
コンパイル使用メモリ 197,520 KB
実行使用メモリ 43,264 KB
最終ジャッジ日時 2024-04-21 17:56:50
合計ジャッジ時間 4,847 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

const int INF=1<<29;

int main(){
	int n; scanf("%d",&n);

	vector dp(n+1,vector(100001,INF));
	dp[0][0]=0;
	rep(i,n){
		int a,b; scanf("%d%d",&a,&b);
		rep(j,100001-a) dp[i+1][j+a]=min(dp[i+1][j+a],dp[i][j]);
		rep(j,100001) dp[i+1][j]=min(dp[i+1][j],dp[i][j]+b);
	}

	int ans=INF;
	rep(j,100001) ans=min(ans,max(j,dp[n][j]));
	printf("%d\n",ans);

	return 0;
}
0