結果
問題 | No.250 atetubouのzetubou |
ユーザー | kroton |
提出日時 | 2015-08-14 09:20:44 |
言語 | C++11 (gcc 11.4.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 831 bytes |
コンパイル時間 | 463 ms |
コンパイル使用メモリ | 58,400 KB |
実行使用メモリ | 41,936 KB |
最終ジャッジ日時 | 2023-09-25 11:32:37 |
合計ジャッジ時間 | 42,105 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | TLE | - |
testcase_02 | TLE | - |
testcase_03 | TLE | - |
testcase_04 | TLE | - |
testcase_05 | TLE | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
ソースコード
#include <iostream> #include <algorithm> using namespace std; const long long MAX_T = 1000000000000000LL; long long cache[1501][1501]; long long patterns(int x, int d) { if (d == 1) { return 1; } if (cache[x][d] >= 0) { return cache[x][d]; } long long result = 0; for (int i = 0; i <= x; ++i) { result += patterns(x - i, d - 1); if (result > MAX_T) { result = MAX_T + 1; continue; } } cache[x][d] = result; return result; } int main() { fill(&cache[0][0], &cache[1500][1500] + 1, -1); int q; cin >> q; for (int i = 0; i < q; ++i) { int d, x; long long t; cin >> d >> x >> t; long long p = patterns(x, d); cout << (p <= t ? "AC" : "ZETUBOU") << endl; } return 0; }