結果

問題 No.250 atetubouのzetubou
ユーザー koyumeishikoyumeishi
提出日時 2015-07-24 23:32:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 796 bytes
コンパイル時間 1,385 ms
コンパイル使用メモリ 77,380 KB
実行使用メモリ 74,316 KB
最終ジャッジ日時 2023-09-22 23:42:24
合計ジャッジ時間 3,654 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 AC 111 ms
74,152 KB
testcase_16 AC 109 ms
73,980 KB
testcase_17 AC 108 ms
74,160 KB
testcase_18 AC 108 ms
73,996 KB
testcase_19 AC 111 ms
74,096 KB
testcase_20 AC 59 ms
74,036 KB
testcase_21 AC 59 ms
74,152 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(3010, vector<long long>(3010,0));
	dp[0][0] = 1;
	for(int i=1; i<=3009; 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] >= 1000000000000001) 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