結果

問題 No.250 atetubouのzetubou
ユーザー irohasu_takaokairohasu_takaoka
提出日時 2019-02-18 20:51:59
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 902 bytes
コンパイル時間 1,642 ms
コンパイル使用メモリ 162,456 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-16 22:25:23
合計ジャッジ時間 13,877 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<bits/stdc++.h>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))
#define BIT(b, i) (((b) >> (i)) & 1)
#define LOG_F 1
#define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__)

using namespace std;

ll pow(int x, int n){
  return n == 0 ? 1 : x * pow(x, n - 1);
}

ll comb(int n, int r){
  if(r==n || r==0) return 1;

  vector<vector<ll>> c(n+1, vector<ll>(n+1,0));
  
  REP(i,n+1){
    c[i][0] = 1;
    c[i][i] = 1;
  }

  REP(i,n){
    REP(j,i){
      c[i+1][j+1] = c[i][j+1] + c[i][j];
    }
  }

  return c[n][r];
}

/*
q
d1 x1 t1

AC
ZETUBOU
 */
int q;

int main(){
  cin>>q;
  REP(k,q){
    int d,x,t,T;
    cin>>d>>x>>t;
    T=comb(x+d-1, d-1);
    if(T>t){
      cout<<"ZETUBOU\n";
    } else {
      cout<<"AC\n";
    }
  }

  return 0;
}
0