結果

問題 No.250 atetubouのzetubou
ユーザー Ai3ShotaAi3Shota
提出日時 2018-08-18 20:36:32
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 601 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 158,176 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-04-24 12:34:16
合計ジャッジ時間 11,357 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define MAX 1500
using namespace std;
typedef long long ll;

ll Q, N;

ll a[MAX + 1][MAX + 1] = {{0}};
ll nCr(ll n, ll r){
    for(int i = 0; i <= MAX; i++){
        for(int j = 0; j <= i; j++){
		    if(j == 0) a[i][j] = 1;
		    else a[i][j] = (a[i - 1][j] + a[i - 1][j - 1]);
        }
	}
	return a[n][r];
}

int main(void){
    
    cin >> Q;
    for(int i = 0; i < Q; ++i){
        ll D, X, T; cin >> D >> X >> T;
        ll ans = nCr(X + D - 1, X);
        if(ans >= 0 && ans <= T) cout << "AC" << endl;
        else cout << "ZETUBOU" << endl;
    }
    
    return 0;
}
0