結果

問題 No.250 atetubouのzetubou
コンテスト
ユーザー しらっ亭
提出日時 2015-09-11 05:12:53
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 125 ms / 5,000 ms
+ 969µs
コード長 662 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 298 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 31,864 KB
最終ジャッジ日時 2026-08-18 02:03:35
合計ジャッジ時間 4,634 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def solve():
    Q = int(input())
    D = [0] * Q
    X = [0] * Q
    T = [0] * Q
    for i in range(Q):
        D[i], X[i], T[i] = map(int, input().split())

    MD = max(D)
    MX = max(X)
    MT = max(T)

    dp = [[MT + 1] * (MX + 1) for d in range(MD + 1)]

    for d in range(1, MD + 1):
        dp1 = dp[d - 1]
        s = 0
        for x in range(MX + 1):
            if d == 1:
                dp[d][x] = 1
            else:
                s += dp1[x]
                dp[d][x] = s
            if s > MT:
                break

    for i in range(Q):
        print('AC' if dp[D[i]][X[i]] <= T[i] else 'ZETUBOU')


if __name__ == '__main__':
    solve()
0