結果

問題 No.250 atetubouのzetubou
ユーザー kobajinkobajin
提出日時 2018-04-03 23:35:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 695 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 52,008 KB
実行使用メモリ 21,224 KB
最終ジャッジ日時 2023-09-08 15:34:46
合計ジャッジ時間 1,845 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
21,016 KB
testcase_01 AC 11 ms
20,980 KB
testcase_02 AC 29 ms
21,224 KB
testcase_03 AC 32 ms
21,080 KB
testcase_04 AC 28 ms
20,936 KB
testcase_05 AC 29 ms
20,940 KB
testcase_06 AC 25 ms
21,016 KB
testcase_07 AC 16 ms
20,936 KB
testcase_08 AC 28 ms
21,004 KB
testcase_09 AC 23 ms
21,128 KB
testcase_10 AC 29 ms
21,008 KB
testcase_11 AC 21 ms
21,008 KB
testcase_12 AC 27 ms
20,988 KB
testcase_13 AC 19 ms
20,996 KB
testcase_14 AC 9 ms
20,932 KB
testcase_15 AC 30 ms
20,992 KB
testcase_16 AC 29 ms
20,924 KB
testcase_17 AC 30 ms
20,920 KB
testcase_18 AC 30 ms
21,000 KB
testcase_19 AC 30 ms
20,940 KB
testcase_20 AC 9 ms
21,000 KB
testcase_21 AC 9 ms
21,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

typedef long long ll;

const int deplim = 1500;
const int xlim = 1500;
const int inf = -1;

ll dp[deplim+1][xlim+1];

void init();
int main(){
  init();

  int q; cin >> q;
  for(int i=0; i<q; i++){
    ll d, x, t;
    cin >> d >> x >> t;

    if(dp[d][x] > t || dp[d][x] < 0){
      cout << "ZETUBOU" << endl;
    }
    else{
      cout << "AC" << endl;
    }
  }

  return 0;
}

void init(){
  for(int i=0; i<=xlim; i++) dp[i][0] = 1;

  for(int d=0; d<deplim; d++){
    for(int x=1; x<=xlim; x++){
      if(dp[d+1][x-1]<0 || dp[d][x]<0){
        dp[d+1][x] = inf;
      }
      else{
        dp[d+1][x] = dp[d+1][x-1] + dp[d][x];
      }
    }
  }
}
0