結果

問題 No.250 atetubouのzetubou
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2017-11-23 21:25:23
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 911 bytes
コンパイル時間 1,948 ms
コンパイル使用メモリ 78,156 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-18 03:29:44
合計ジャッジ時間 2,225 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
4,380 KB
testcase_01 AC 4 ms
4,380 KB
testcase_02 AC 23 ms
4,376 KB
testcase_03 AC 25 ms
4,380 KB
testcase_04 AC 22 ms
4,380 KB
testcase_05 AC 23 ms
4,380 KB
testcase_06 AC 18 ms
4,376 KB
testcase_07 AC 10 ms
4,376 KB
testcase_08 AC 21 ms
4,380 KB
testcase_09 AC 16 ms
4,380 KB
testcase_10 AC 23 ms
4,376 KB
testcase_11 AC 14 ms
4,376 KB
testcase_12 AC 21 ms
4,380 KB
testcase_13 AC 12 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 70 ms
4,380 KB
testcase_16 AC 72 ms
4,380 KB
testcase_17 AC 71 ms
4,380 KB
testcase_18 AC 73 ms
4,380 KB
testcase_19 AC 71 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    int Q;
    cin >> Q;
    int D,X;
    long long T;
    vector<string> ans;
    for ( int i = 0; i < Q; i++ ) {
        cin >> D >> X >> T;
        long long a = 1;
        
        if ( D == 1 ) { a = 1; }
        else {
            for ( int j = 1; j < D; j++ ) {                
                a *= X+j;
                a /= j;
                // cout << a << endl;
                if ( a > T ) { break; }
            }
        }
    
        ans.push_back( ( a <= T ) ? "AC" : "ZETUBOU" );
    }
    for ( int i = 0; i < Q; i++ ) {
        cout << ans[i] << endl;
    }
    
    
    return 0;
}
0