結果

問題 No.250 atetubouのzetubou
ユーザー fumiphys
提出日時 2018-08-19 14:56:51
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 939 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 71,952 KB
実行使用メモリ 42,112 KB
最終ジャッジ日時 2024-11-17 07:20:51
合計ジャッジ時間 70,944 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 TLE * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, const char**)’:
main.cpp:27:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 |         scanf("%d", &q);
      |         ~~~~~^~~~~~~~~~
main.cpp:31:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   31 |                         scanf("%d %d %lld", &d, &x, &t);
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <cstdio>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
const int inf = 1e9;
const ll linf = 1LL << 50;
ll dp[1501][1501];

int main(int argc, char const* argv[])
{
	int q;
	scanf("%d", &q);
	for(int i = 0; i < q; i++){
			int d, x;
			ll t;
			scanf("%d %d %lld", &d, &x, &t);
			for(int j = 0; j <= d; j++){
					for(int k = 0; k <= x; k++){
							dp[j][k] = 0;
					}
			}
			dp[0][0] = 1;
			for(int j = 0; j < d; j++){
					dp[j+1][0] = 1;
					for(int k = 1; k <= x; k++){
							dp[j+1][k] = dp[j][k] + dp[j+1][k-1];
					}
			}
			if(dp[d][x] >= 0 && t >= dp[d][x])cout << "AC" << endl;
			else cout << "ZETUBOU" << endl;
	}
	return 0;
}
0