結果

問題 No.250 atetubouのzetubou
ユーザー MisterMister
提出日時 2020-04-13 11:39:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 910 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 76,292 KB
実行使用メモリ 73,732 KB
最終ジャッジ日時 2023-10-24 21:05:49
合計ジャッジ時間 3,324 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 63 ms
73,732 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 64 ms
73,732 KB
testcase_21 AC 63 ms
73,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

template <class T>
std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); }

using lint = long long;

constexpr int X = 3000;
constexpr lint INF = 1LL << 50;

std::vector<std::vector<lint>> comb;

void init() {
    comb = vec(X + 1, vec(X + 1, 0LL));
    comb[0][0] = 1;
    for (int x = 1; x <= X; ++x) {
        for (int y = 0; y <= x; ++y) {
            comb[x][y] = (y > 0 ? comb[x - 1][y - 1] : 0) +
                         (y < x ? comb[x - 1][y] : 0);
            comb[x][y] = std::min(comb[x][y], INF);
        }
    }
}

void solve() {
    int d, x, t;
    std::cin >> d >> x >> t;

    std::cout << (comb[x + d - 1][d - 1] <= t ? "AC" : "ZETUBOU")
              << std::endl;
}

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

    init();

    int q;
    std::cin >> q;
    while (q--) solve();

    return 0;
}
0