結果
| 問題 | No.250 atetubouのzetubou | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-09-23 17:24:09 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 76 ms / 5,000 ms | 
| コード長 | 781 bytes | 
| コンパイル時間 | 541 ms | 
| コンパイル使用メモリ | 66,380 KB | 
| 実行使用メモリ | 73,728 KB | 
| 最終ジャッジ日時 | 2024-07-19 08:48:49 | 
| 合計ジャッジ時間 | 2,744 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 20 | 
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
typedef vector<long long> VLL;
typedef vector<VLL> VVLL;
VVLL pascal;
const long long INF = 1e16;
const int PASCAL_MAX = 3000;
void make_pascal() {
	pascal.assign(PASCAL_MAX + 1, VLL(PASCAL_MAX + 1, INF));
	pascal[0][0] = 1;
	for (int i = 1; i <= PASCAL_MAX; i++) {
		pascal[i][0] = 1;
		pascal[i][i] = 1;
		for (int j = 1; j < i; j++) {
			pascal[i][j] = min(INF, pascal[i - 1][j - 1] + pascal[i - 1][j]);
		}
	}
}
int main() {
	make_pascal();
	int q, d, x;
	long long t;
	cin >> q;
	vector<bool> ok(q);
	for (int i = 0; i < q; i++) {
		cin >> d >> x >> t;
		d--;
		ok[i] = (pascal[d+x][x] <= t);
	}
	for (int i = 0; i < q; i++) {
		cout << (ok[i] ? "AC" : "ZETUBOU") << endl;
	}
	return 0;
}
            
            
            
        