結果
| 問題 | No.710 チーム戦 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-11 23:29:00 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 3,000 ms |
| コード長 | 452 bytes |
| 記録 | |
| コンパイル時間 | 1,288 ms |
| コンパイル使用メモリ | 214,688 KB |
| 実行使用メモリ | 43,648 KB |
| 最終ジャッジ日時 | 2026-06-11 08:23:24 |
| 合計ジャッジ時間 | 3,707 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
#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;
}