結果

問題 No.250 atetubouのzetubou
ユーザー 👑 kmjpkmjp
提出日時 2015-07-24 22:30:12
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 1,294 bytes
コンパイル時間 1,310 ms
コンパイル使用メモリ 146,012 KB
実行使用メモリ 73,036 KB
最終ジャッジ日時 2023-09-22 22:26:26
合計ジャッジ時間 3,180 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
72,996 KB
testcase_01 AC 24 ms
72,956 KB
testcase_02 AC 37 ms
72,928 KB
testcase_03 AC 39 ms
72,936 KB
testcase_04 AC 36 ms
72,960 KB
testcase_05 AC 38 ms
72,900 KB
testcase_06 AC 34 ms
72,948 KB
testcase_07 AC 28 ms
72,968 KB
testcase_08 AC 36 ms
72,956 KB
testcase_09 AC 32 ms
72,928 KB
testcase_10 AC 38 ms
72,888 KB
testcase_11 AC 31 ms
72,892 KB
testcase_12 AC 36 ms
72,940 KB
testcase_13 AC 30 ms
73,036 KB
testcase_14 AC 23 ms
73,020 KB
testcase_15 AC 39 ms
73,000 KB
testcase_16 AC 38 ms
72,900 KB
testcase_17 AC 39 ms
73,036 KB
testcase_18 AC 38 ms
72,884 KB
testcase_19 AC 39 ms
72,936 KB
testcase_20 AC 22 ms
72,880 KB
testcase_21 AC 22 ms
72,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll comb(int P_,int Q_) {
	static const int N_=3020;
	static ll C_[N_][N_];
	
	if(C_[0][0]==0) {
		int i,j;
		FOR(i,N_) C_[i][0]=C_[i][i]=1;
		for(i=1;i<N_;i++) for(j=1;j<i;j++) {
			C_[i][j]=(C_[i-1][j-1]+C_[i-1][j]);
			if(C_[i][j]>=1LL<<60) C_[i][j]=1LL<<60;
		}
	}
	if(P_<0 || P_>N_ || Q_<0 || Q_>P_) return 0;
	return C_[P_][Q_];
}
ll hcomb(int P_,int Q_) { return (P_==0&&Q_==0)?1:comb(P_+Q_-1,Q_);};
ll mul(ll a,ll b) {
	if(a*b<a) return 1LL<<60;
	return a*b;
}

int Q;
ll D,X;
ll T;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>Q;
	FOR(i,Q) {
		cin>>D>>X>>T;
		if(hcomb(D,X)<=T) cout<<"AC"<<endl;
		else cout<<"ZETUBOU"<<endl;
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0