結果

問題 No.250 atetubouのzetubou
ユーザー tkmst201tkmst201
提出日時 2017-04-11 22:15:19
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 1,126 bytes
コンパイル時間 1,428 ms
コンパイル使用メモリ 143,492 KB
実行使用メモリ 21,100 KB
最終ジャッジ日時 2023-09-25 11:17:41
合計ジャッジ時間 3,036 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
21,004 KB
testcase_01 AC 13 ms
20,996 KB
testcase_02 AC 16 ms
21,064 KB
testcase_03 AC 17 ms
21,064 KB
testcase_04 AC 16 ms
21,064 KB
testcase_05 AC 16 ms
21,008 KB
testcase_06 AC 15 ms
21,100 KB
testcase_07 AC 14 ms
21,000 KB
testcase_08 AC 16 ms
21,096 KB
testcase_09 AC 15 ms
21,012 KB
testcase_10 AC 16 ms
21,068 KB
testcase_11 AC 15 ms
21,024 KB
testcase_12 AC 16 ms
21,016 KB
testcase_13 AC 15 ms
21,000 KB
testcase_14 AC 13 ms
21,000 KB
testcase_15 AC 16 ms
21,068 KB
testcase_16 AC 16 ms
21,100 KB
testcase_17 AC 16 ms
21,000 KB
testcase_18 AC 16 ms
21,044 KB
testcase_19 AC 17 ms
21,004 KB
testcase_20 AC 13 ms
21,000 KB
testcase_21 AC 12 ms
21,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> P;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-10;

int q;
ll dp[1501][1501];
ll sum[1501];

int main() {
	dp[0][0] = 1;
	
	REP(i, 1500) {
		REP(j, 1501) sum[j] = dp[i][j];
		FOR(j, 1, 1501) {
			if (sum[j - 1] == -1 || sum[j] == -1) sum[j] = -1;
			else {
				sum[j] += sum[j - 1];
				if (sum[j] > 1000000000000000ll) sum[j] = -1;
			}
		}
		
		REP(j, 1501) {
			if (sum[j] == -1) dp[i + 1][j] = -1;
			else dp[i + 1][j] = sum[j];
		}
	}
	
	cin >> q;
	REP(i, q) {
		ll d, x, t;
		scanf("%lld %lld %lld", &d, &x, &t);
		
		puts(dp[d][x] == -1 || dp[d][x] > t ? "ZETUBOU" : "AC");
	}
	return 0;
}
0