結果

問題 No.250 atetubouのzetubou
ユーザー tkmst201tkmst201
提出日時 2017-04-11 22:35:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 1,038 bytes
コンパイル時間 1,137 ms
コンパイル使用メモリ 143,424 KB
実行使用メモリ 72,276 KB
最終ジャッジ日時 2023-09-25 11:18:13
合計ジャッジ時間 2,758 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
72,276 KB
testcase_01 AC 22 ms
72,080 KB
testcase_02 AC 25 ms
72,168 KB
testcase_03 AC 26 ms
72,168 KB
testcase_04 AC 25 ms
72,096 KB
testcase_05 AC 25 ms
72,092 KB
testcase_06 AC 25 ms
72,152 KB
testcase_07 AC 23 ms
72,148 KB
testcase_08 AC 25 ms
72,144 KB
testcase_09 AC 24 ms
72,100 KB
testcase_10 AC 25 ms
72,084 KB
testcase_11 AC 23 ms
72,096 KB
testcase_12 AC 25 ms
72,092 KB
testcase_13 AC 23 ms
72,116 KB
testcase_14 AC 21 ms
72,084 KB
testcase_15 AC 25 ms
72,096 KB
testcase_16 AC 25 ms
72,120 KB
testcase_17 AC 25 ms
72,184 KB
testcase_18 AC 25 ms
72,172 KB
testcase_19 AC 25 ms
72,108 KB
testcase_20 AC 21 ms
72,084 KB
testcase_21 AC 22 ms
72,148 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[3001][3001];

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(3000, 3000);
	
	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