結果

問題 No.250 atetubouのzetubou
ユーザー koyumeishikoyumeishi
提出日時 2015-07-24 23:40:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 77,072 KB
実行使用メモリ 128,484 KB
最終ジャッジ日時 2023-09-22 23:52:02
合計ジャッジ時間 4,525 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 112 ms
128,188 KB
testcase_15 AC 134 ms
128,312 KB
testcase_16 AC 133 ms
128,284 KB
testcase_17 AC 133 ms
128,464 KB
testcase_18 AC 133 ms
128,224 KB
testcase_19 AC 134 ms
128,188 KB
testcase_20 AC 114 ms
128,200 KB
testcase_21 AC 112 ms
128,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;

int main(){
	int q;
	cin >> q;

	vector<vector<long long>> dp(4000, vector<long long>(4000,0));
	dp[0][0] = 1;
	for(int i=1; i<4000; i++){
		for(int j=0; j<=i; j++){
			if((dp[i-1][j] < 0) || (j>0 && dp[i-1][j] < 0) ){
				dp[i][j] = -1;
				continue;
			}

			dp[i][j] = dp[i-1][j] + (j>0?dp[i-1][j-1]:0);
			if(dp[i][j] >= 1e16) dp[i][j] = -1;
		}
	}

	while(q--){
		long long d,x;
		long long t;
		cin >> d >> x >> t;

		//cerr << dp[d+x-1][x] << endl;
		if(dp[d+x-1][x] >= 0 && dp[d+x-1][x] <= t){
			cout << "AC" << endl;
		}else{
			cout << "ZETUBOU" << endl;
		}

	}
	return 0;
}
0