結果

問題 No.250 atetubouのzetubou
ユーザー walkrewalkre
提出日時 2015-08-01 16:26:28
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 1,240 bytes
コンパイル時間 1,333 ms
コンパイル使用メモリ 144,608 KB
実行使用メモリ 126,900 KB
最終ジャッジ日時 2023-09-25 00:15:43
合計ジャッジ時間 3,420 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
126,608 KB
testcase_01 AC 36 ms
126,600 KB
testcase_02 AC 49 ms
126,612 KB
testcase_03 AC 50 ms
126,624 KB
testcase_04 AC 48 ms
126,656 KB
testcase_05 AC 49 ms
126,660 KB
testcase_06 AC 45 ms
126,660 KB
testcase_07 AC 40 ms
126,768 KB
testcase_08 AC 48 ms
126,624 KB
testcase_09 AC 44 ms
126,600 KB
testcase_10 AC 49 ms
126,668 KB
testcase_11 AC 43 ms
126,724 KB
testcase_12 AC 48 ms
126,728 KB
testcase_13 AC 42 ms
126,884 KB
testcase_14 AC 35 ms
126,828 KB
testcase_15 AC 50 ms
126,612 KB
testcase_16 AC 51 ms
126,608 KB
testcase_17 AC 50 ms
126,604 KB
testcase_18 AC 50 ms
126,900 KB
testcase_19 AC 51 ms
126,728 KB
testcase_20 AC 34 ms
126,596 KB
testcase_21 AC 35 ms
126,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define mp(a,b) make_pair((a),(b))
#define debug(x) #x << "=" << (x)
 
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int INF=1<<30;
const long long int INFLL=1LL<<58;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
	os << "[";
	for (const auto &v : vec) {
		os << v << ",";
	}
	os << "]";
	return os;
}

void Solve(){
	static ll comb[4000][4000];
	const ll maxi=1e15+1;
	rep(i,0,4000) comb[i][0]=1;
	rep(i,0,4000) comb[i][i]=1;
	rep(i,1,4000){
		rep(j,1,i+1){
			if(comb[i-1][j-1]>=maxi||comb[i-1][j]>=maxi){
				comb[i][j]=maxi;
				continue;
			}
			comb[i][j]=comb[i-1][j-1]+comb[i-1][j];
		}
	}
	
	int q;
	cin >> q;
	rep(i,0,q){
		ll d,x,t;
		cin >> d >> x >> t;
		if(comb[x+d-1][d-1]<=t) cout << "AC" << endl;
		else cout << "ZETUBOU" << endl;
	}
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	Solve();
	return 0;
}
0