結果

問題 No.250 atetubouのzetubou
ユーザー llllll
提出日時 2018-04-07 21:49:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,210 bytes
コンパイル時間 1,861 ms
コンパイル使用メモリ 90,660 KB
実行使用メモリ 12,236 KB
最終ジャッジ日時 2023-09-08 18:16:36
合計ジャッジ時間 13,626 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int Q;
    ll D[10007];
    ll X[10007];
    ll T[10007];

    cin >> Q;
    for (int i = 0; i < Q; i++) {
        cin >> D[i] >> X[i] >> T[i];
    }

    for (int i = 0; i < Q; i++) {
        ll prev[1507] = {};
        ll cur[1507] = {};
        prev[0] = 1;

        for (int j = 0; j < D[i]; j++) {
            for (int s = 0; s <= X[i]; s++) {
                cur[s] = 0;
                for (int k = 0; k <= s; k++) {
                    cur[s] += prev[k];
                    if (cur[s] > T[i])
                        goto zetubou;
                }
            }
            for (int s = 0; s <= X[i]; s++) {
                prev[s] = cur[s];
            }
        }

        cout << cur[X[i]] << endl;
        if (cur[X[i]] <= T[i]) {
            cout << "AC" << endl;
        } else {
zetubou:
            cout << "ZETUBOU" << endl;
        }
    }

    return 0;
}
0