結果
| 問題 |
No.710 チーム戦
|
| コンテスト | |
| ユーザー |
tempura_pp
|
| 提出日時 | 2018-06-29 23:24:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 3,000 ms |
| コード長 | 826 bytes |
| コンパイル時間 | 621 ms |
| コンパイル使用メモリ | 82,820 KB |
| 実行使用メモリ | 51,584 KB |
| 最終ジャッジ日時 | 2024-07-01 00:15:51 |
| 合計ジャッジ時間 | 3,183 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
#include<math.h>
#include<string>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef long long ll;
typedef pair<int,int> pint;
const ll mod= 1e9+7;
const int inf=1e9+7;
const ll longinf = 1LL<<60;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
int main(){
int n;
cin>>n;
int a[n],b[n];
rep(i,n)cin>>a[i]>>b[i];
int dp[111][111111];
rep(i,111)rep(j,111111)dp[i][j]=inf;
dp[0][0]=0;
rep(i,n)rep(j,100010){
dp[i+1][j+a[i]]=min(dp[i+1][j+a[i]],dp[i][j]);
dp[i+1][j]=min(dp[i+1][j],dp[i][j]+b[i]);
}
int ans=inf;
rep(i,101010)ans=min(ans,max(i,dp[n][i]));
cout<<ans<<endl;
return 0;
}
tempura_pp