結果

問題 No.250 atetubouのzetubou
ユーザー fumiphysfumiphys
提出日時 2018-08-19 15:03:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 1,035 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 71,980 KB
実行使用メモリ 21,208 KB
最終ジャッジ日時 2024-04-28 14:50:17
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
21,120 KB
testcase_01 AC 11 ms
21,108 KB
testcase_02 AC 24 ms
21,112 KB
testcase_03 AC 26 ms
21,120 KB
testcase_04 AC 23 ms
21,196 KB
testcase_05 AC 23 ms
21,104 KB
testcase_06 AC 20 ms
21,208 KB
testcase_07 AC 15 ms
21,120 KB
testcase_08 AC 24 ms
20,936 KB
testcase_09 AC 19 ms
20,944 KB
testcase_10 AC 23 ms
20,904 KB
testcase_11 AC 18 ms
21,168 KB
testcase_12 AC 25 ms
21,088 KB
testcase_13 AC 16 ms
21,116 KB
testcase_14 AC 9 ms
21,120 KB
testcase_15 AC 27 ms
21,120 KB
testcase_16 AC 25 ms
21,120 KB
testcase_17 AC 25 ms
21,056 KB
testcase_18 AC 25 ms
21,028 KB
testcase_19 AC 26 ms
21,048 KB
testcase_20 AC 9 ms
21,060 KB
testcase_21 AC 9 ms
21,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:45:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   45 |                         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 j = 0; j <= 1500; j++){
			for(int k = 0; k <= 1500; k++){
					dp[j][k] = 0;
			}
	}
	dp[0][0] = 1;
	for(int j = 0; j < 1500; j++){
			dp[j+1][0] = 1;
			for(int k = 1; k <= 1500; k++){
					if(dp[j][k] >= 0 && dp[j+1][k-1] >= 0)dp[j+1][k] = dp[j][k] + dp[j+1][k-1];
					else dp[j+1][k] = -1;
					if(dp[j+1][k] > 1e15)dp[j+1][k] = -1;
			}
	}
	for(int i = 0; i < q; i++){
			int d, x;
			ll t;
			scanf("%d %d %lld", &d, &x, &t);
			if(dp[d][x] >= 0 && t >= dp[d][x])cout << "AC" << endl;
			else cout << "ZETUBOU" << endl;
	}
	return 0;
}
0