結果

問題 No.250 atetubouのzetubou
ユーザー 184184
提出日時 2015-07-24 23:04:18
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 2,946 ms
コンパイル使用メモリ 38,488 KB
実行使用メモリ 19,472 KB
最終ジャッジ日時 2023-09-22 22:49:12
合計ジャッジ時間 1,406 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <algorithm>
using namespace std;

//namaega184

long long nCk[1505][1505];
int main(){
	int q,d,x;long long t;scanf("%d",&q);
	nCk[0][0]=1;
	long long maxt=(long long)1e16;
	for(int i=1;i<=1500;i++){
		nCk[i][0]=nCk[i][i]=1;for(int j=1;j<i;j++){nCk[i][j]=nCk[i-1][j-1]+nCk[i-1][j];if(nCk[i][j]>=maxt)nCk[i][j]=maxt;}
	} 
	for(int i=0;i<q;i++){
		scanf("%d%d%lld",&d,&x,&t);
		x++;
		long long s=0;
		bool flag=0;
		if(d==1){s=1;if(s>t)flag=1;}
		for(int j=1;j<d;j++){
			s+=nCk[x][j];
			if(s>t){flag=1;break;}
		}
		if(flag)printf("ZETUBOU\n");
		else printf("AC\n");
	}
	return 0;
}
0