結果

問題 No.250 atetubouのzetubou
ユーザー beet
提出日時 2018-08-03 15:24:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 655 bytes
コンパイル時間 1,445 ms
コンパイル使用メモリ 167,036 KB
実行使用メモリ 34,816 KB
最終ジャッジ日時 2024-09-19 17:25:28
合計ジャッジ時間 3,312 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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