結果

問題 No.250 atetubouのzetubou
ユーザー springrollspringroll
提出日時 2019-03-10 01:41:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 916 bytes
コンパイル時間 1,546 ms
コンパイル使用メモリ 166,988 KB
実行使用メモリ 38,064 KB
最終ジャッジ日時 2023-09-05 19:52:51
合計ジャッジ時間 3,169 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_15 AC 35 ms
37,996 KB
testcase_16 AC 35 ms
37,880 KB
testcase_17 AC 36 ms
37,864 KB
testcase_18 AC 35 ms
37,880 KB
testcase_19 AC 36 ms
37,868 KB
testcase_20 AC 15 ms
37,612 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

typedef long long ll;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define INF (1<<30)

ll comb[3010][1510];

void calc_comb(ll n, ll k) {
	comb[0][0] = 0;
	comb[1][0] = comb[1][1] = 1;

	for (ll i = 2; i < n; i++) {
		for (ll j = 0; j < k; j++) {
			if(i<j) continue;
			if(j==0 || j==i) comb[i][j] = 1;
			else {
				if(comb[i-1][j]==-1 || comb[i-1][j-1]==-1) comb[i][j]=-1;
				else comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1];
			}
			if(comb[i][j] > (ll)1e20) comb[i][j]=-1;
		}
	}
}


int main() {
	calc_comb(3010,1510);

	ll Q; cin >> Q;
	vector<ll> D(Q), X(Q), T(Q);
	for(ll i=0; i<Q; i++) cin >> D[i] >> X[i] >> T[i];
	for (ll i = 0; i < Q; i++) {
		//cout << comb[X[i]+D[i]-1][X[i]] << endl;
		if (comb[X[i] + D[i] - 1][X[i]] > T[i] || comb[X[i] + D[i] - 1][X[i]] == -1) {
			cout << "ZETUBOU" << endl;
		}
		else {
			cout << "AC" << endl;
		}
	}
}
0