結果

問題 No.250 atetubouのzetubou
ユーザー tkmst201tkmst201
提出日時 2017-04-11 22:34:43
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,038 bytes
コンパイル時間 1,233 ms
コンパイル使用メモリ 143,556 KB
実行使用メモリ 19,916 KB
最終ジャッジ日時 2023-09-25 11:18:07
合計ジャッジ時間 6,294 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 8 ms
19,796 KB
testcase_21 AC 7 ms
19,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> P;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-10;

ll ncr[1501][1501];

void nCr(ll n, ll r) {
	REP(i, n + 1) {
		REP(j, i + 1) {
			if (j == 0 || j == i) ncr[i][j] = 1;
			else {
				ncr[i][j] = ncr[i - 1][j - 1] + ncr[i - 1][j];
				chmin(ncr[i][j], 1ll<<61);
			}
		}
	}
}

ll nhr(ll n, ll r) {
	return ncr[n + r - 1][r];
}

int main() {
	nCr(1500, 1500);
	
	int q;
	cin >> q;
	REP(i, q) {
		ll d, x, t;
		scanf("%lld %lld %lld", &d, &x, &t);
		
		puts(nhr(d, x) <= t ? "AC" : "ZETUBOU");
	}
	return 0;
}
0