結果

問題 No.250 atetubouのzetubou
ユーザー beetbeet
提出日時 2018-08-03 15:24:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 655 bytes
コンパイル時間 1,620 ms
コンパイル使用メモリ 166,984 KB
実行使用メモリ 35,000 KB
最終ジャッジ日時 2023-10-19 21:22:52
合計ジャッジ時間 3,197 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
35,000 KB
testcase_01 AC 18 ms
35,000 KB
testcase_02 AC 37 ms
35,000 KB
testcase_03 AC 40 ms
35,000 KB
testcase_04 AC 36 ms
35,000 KB
testcase_05 AC 37 ms
35,000 KB
testcase_06 AC 32 ms
35,000 KB
testcase_07 AC 24 ms
35,000 KB
testcase_08 AC 36 ms
35,000 KB
testcase_09 AC 31 ms
35,000 KB
testcase_10 AC 37 ms
35,000 KB
testcase_11 AC 28 ms
35,000 KB
testcase_12 AC 35 ms
35,000 KB
testcase_13 AC 26 ms
35,000 KB
testcase_14 AC 16 ms
35,000 KB
testcase_15 AC 38 ms
35,000 KB
testcase_16 AC 37 ms
35,000 KB
testcase_17 AC 37 ms
35,000 KB
testcase_18 AC 37 ms
35,000 KB
testcase_19 AC 37 ms
35,000 KB
testcase_20 AC 16 ms
35,000 KB
testcase_21 AC 16 ms
35,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;


template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
const Int INF = 1e16;
const Int MAX = 2000;
Int dp[MAX][MAX];

signed main(){
  memset(dp,0,sizeof(dp));
  dp[0][0]=1;
  for(Int i=0;i+1<MAX;i++){
    Int res=0;
    for(Int j=0;j<MAX;j++){
      res+=dp[i][j];
      chmin(res,INF);
      dp[i+1][j]=res;      
    }    
  }
  
  Int q;
  cin>>q;
  while(q--){
    Int d,x,t;
    cin>>d>>x>>t;
    cout<<(dp[d][x]<=t?"AC":"ZETUBOU")<<endl;
  }
  return 0;
}
0