結果

問題 No.250 atetubouのzetubou
ユーザー springrollspringroll
提出日時 2019-03-10 01:35:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 720 bytes
コンパイル時間 1,471 ms
コンパイル使用メモリ 164,976 KB
実行使用メモリ 37,964 KB
最終ジャッジ日時 2023-09-05 19:52:39
合計ジャッジ時間 3,020 ms
ジャッジサーバーID
(参考情報)
judge14 / 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 14 ms
37,632 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 14 ms
37,712 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(int n, int k) {
	comb[0][0] = 0;
	comb[1][0] = comb[1][1] = 1;

	for (int i = 2; i < n; i++) {
		for (int j = 0; j < k; j++) {
			if(i<j) continue;
			if(j==0) 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);

	int Q; cin >> Q;
	for (int i = 0; i < Q; i++) {
		int D, X, T;
		cin >> D >> X >> T;

		if (comb[X + D - 1][X] > T || comb[X + D - 1][X] == -1) {
			cout << "ZETUBOU" << endl;
		}
		else {
			cout << "AC" << endl;
		}
	}
}
0