結果

問題 No.710 チーム戦
ユーザー tempura_pptempura_pp
提出日時 2018-06-29 23:24:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 33 ms / 3,000 ms
コード長 826 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 76,856 KB
実行使用メモリ 51,748 KB
最終ジャッジ日時 2023-09-13 15:40:37
合計ジャッジ時間 2,898 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
51,552 KB
testcase_01 AC 19 ms
51,516 KB
testcase_02 AC 33 ms
51,536 KB
testcase_03 AC 32 ms
51,748 KB
testcase_04 AC 32 ms
51,352 KB
testcase_05 AC 31 ms
51,492 KB
testcase_06 AC 33 ms
51,444 KB
testcase_07 AC 31 ms
51,488 KB
testcase_08 AC 32 ms
51,452 KB
testcase_09 AC 32 ms
51,348 KB
testcase_10 AC 32 ms
51,388 KB
testcase_11 AC 33 ms
51,448 KB
testcase_12 AC 32 ms
51,616 KB
testcase_13 AC 32 ms
51,548 KB
testcase_14 AC 31 ms
51,728 KB
testcase_15 AC 31 ms
51,592 KB
testcase_16 AC 31 ms
51,380 KB
testcase_17 AC 32 ms
51,644 KB
testcase_18 AC 32 ms
51,664 KB
testcase_19 AC 31 ms
51,540 KB
testcase_20 AC 33 ms
51,380 KB
testcase_21 AC 32 ms
51,540 KB
testcase_22 AC 33 ms
51,628 KB
testcase_23 AC 33 ms
51,352 KB
testcase_24 AC 31 ms
51,668 KB
testcase_25 AC 18 ms
51,444 KB
testcase_26 AC 18 ms
51,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;

  }
0