結果

問題 No.710 チーム戦
ユーザー CleyLCleyL
提出日時 2022-11-08 14:48:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 571 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 68,536 KB
実行使用メモリ 43,072 KB
最終ジャッジ日時 2023-09-29 04:45:30
合計ジャッジ時間 7,146 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int dp[101][100001];

int main(){
  int n;cin>>n;
  for(int i = 0; 100 > i; i++){
    for(int j = 0; 100000 >= j; j++){
      dp[i][j] = 100001;
    }
  }
  dp[0][0] = 0;
  for(int i = 0; n > i; i++){
    int a,b;cin>>a>>b;
    for(int j = 0; 100000 > j; j++){
      if(!dp[i][j] && i+j != 0)continue;
      dp[i+1][j+a] = min(dp[i+1][j+a],dp[i][j]);
      dp[i+1][j] = min(dp[i+1][j],dp[i][j]+b);
    }
  }
  int ans = 100000;
  for(int i = 0; 100000 >= i; i++){
    ans = min(ans,max(i,dp[n][i]));
  }
  cout << ans << endl;
}
0