結果

問題 No.250 atetubouのzetubou
ユーザー chakku
提出日時 2015-09-17 03:16:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 851 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 58,996 KB
実行使用メモリ 32,768 KB
最終ジャッジ日時 2024-07-19 06:50:37
合計ジャッジ時間 2,800 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 1 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;

ll Q,D,X,T;

ll comb[4000][2000];

ll combination(ll n,ll r){
    if(r<=0||n<r) return 0;
    else if(comb[n][r]!=0) return comb[n][r];
    else if(r==1) return comb[n][r]=n;
    else{
        comb[n][r]=0;
        comb[n][r]+=combination(n-1,r);
        if(comb[n][r]>T){
            comb[n][r]=T+10;
            return comb[n][r];
        }else{
            comb[n][r]+=combination(n-1,r-1);
        }
        if(comb[n][r]>T){
            comb[n][r]=T+10;
        }
        return comb[n][r];
    }
}

void solve(){
    cin>>D>>X>>T;
    if(combination(D+X-1,X)>T){
        cout<<"ZETUBOU"<<endl;
    }else{
        cout<<"AC"<<endl;
    }
    return;
}

int main(){
    cin>>Q;
    for(int i=0;i<Q;i++){
        solve();
    }
    return 0;
}
0