結果

問題 No.250 atetubouのzetubou
ユーザー chakkuchakku
提出日時 2015-09-17 03:16:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 851 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 60,900 KB
実行使用メモリ 32,912 KB
最終ジャッジ日時 2023-09-26 12:20:59
合計ジャッジ時間 3,287 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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