結果

問題 No.250 atetubouのzetubou
ユーザー machy
提出日時 2015-07-24 22:49:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 753 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 55,200 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 13:25:20
合計ジャッジ時間 2,153 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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(f%c == 0) return c;
    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;
        //cerr << v << ", " << t << endl;
            if(v > t){
                flag = true;
                break;
            }
        }
        if(flag){
            cout << "ZETUBOU" << endl;
        }else{
            cout << "AC" << endl;
        }
    }
    return 0;
}
0