結果

問題 No.250 atetubouのzetubou
ユーザー かにかに
提出日時 2015-12-04 22:23:35
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 924 bytes
コンパイル時間 1,300 ms
コンパイル使用メモリ 147,084 KB
実行使用メモリ 4,476 KB
最終ジャッジ日時 2023-10-12 14:33:03
合計ジャッジ時間 2,621 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0;i < n;i++)
#define P(p) cout<<(p)<<endl;
#define pi 3.1415926535
using namespace std;
typedef long long ll;
int dx[] = { 0, 1, 0, -1 };
int dy[] = { -1, 0, 1, 0 };

unsigned long long sttoi(std::string str) {
	unsigned long long ret;
	std::stringstream ss; ss << str;
	ss >> ret;
	return ret;
}

ll gcd(ll a, ll b){
	if (b > a)swap(a, b); if (b == 0)return a; else{ return gcd(b, a%b); }
}

ll combination(int a,int b){
	ll ret = 1;
	for (int i = 0; i < b; i++){
		ret *= a - i;
		ret /= i + 1;
		if (ret / 1e15 > 0){
			return -1;
		}
	}
	return ret;
}

void solve() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		ll d, x, t;
		cin >> d >> x >> t;
		ll ans = combination(x + d - 2, d - 2);
		if (ans == -1 || ans > t){
			P("ZETUBOU");
		} else{
			P("AC");
		}
	}
}

int main() {
	solve();
	return 0;
}
0