結果

問題 No.250 atetubouのzetubou
ユーザー machy
提出日時 2015-07-24 23:54:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 817 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 54,868 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-16 00:40:16
合計ジャッジ時間 5,749 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
typedef unsigned long long LL;

LL gcd(LL f, LL c){
    if(c == 0) return f;
    return gcd(c, f%c);
}

int main(){
    int Q;
    cin >> Q;
    for(int q = 0; q < Q; q++){
        LL d, x, t;
        cin >> d >> x >> t;
        LL v = 1;
        bool flag = false;
        for(int i = 0; i < d-1; i++){
            v *= x + i + 1;
            LL f = i + 1;
            LL c = gcd(f, v);
            v /= c;
            t *= f/c;
            c = gcd(v, t);
            v /= c;
            t /= c;
        //cerr << v << ", " << t << endl;
            if(v > t){
                flag = true;
                break;
            }
        }
        if(flag){
            cout << "ZETUBOU" << endl;
        }else{
            cout << "AC" << endl;
        }
    }
    return 0;
}
0