結果

問題 No.250 atetubouのzetubou
ユーザー kobajin
提出日時 2018-04-03 23:35:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 695 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 55,032 KB
実行使用メモリ 21,120 KB
最終ジャッジ日時 2024-06-26 08:36:29
合計ジャッジ時間 1,993 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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