結果

問題 No.250 atetubouのzetubou
ユーザー nanaenanae
提出日時 2017-03-30 12:46:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,909 ms / 5,000 ms
コード長 624 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 79,708 KB
最終ジャッジ日時 2023-09-21 08:39:28
合計ジャッジ時間 44,933 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,899 ms
79,528 KB
testcase_01 AC 1,885 ms
79,580 KB
testcase_02 AC 1,893 ms
79,540 KB
testcase_03 AC 1,898 ms
79,492 KB
testcase_04 AC 1,890 ms
79,584 KB
testcase_05 AC 1,897 ms
79,632 KB
testcase_06 AC 1,899 ms
79,524 KB
testcase_07 AC 1,897 ms
79,472 KB
testcase_08 AC 1,892 ms
79,480 KB
testcase_09 AC 1,889 ms
79,528 KB
testcase_10 AC 1,908 ms
79,524 KB
testcase_11 AC 1,886 ms
79,576 KB
testcase_12 AC 1,891 ms
79,488 KB
testcase_13 AC 1,887 ms
79,628 KB
testcase_14 AC 1,877 ms
79,476 KB
testcase_15 AC 1,899 ms
79,708 KB
testcase_16 AC 1,909 ms
79,672 KB
testcase_17 AC 1,903 ms
79,696 KB
testcase_18 AC 1,903 ms
79,684 KB
testcase_19 AC 1,904 ms
79,644 KB
testcase_20 AC 1,884 ms
79,488 KB
testcase_21 AC 1,891 ms
79,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

inf = 10**15 + 1

def solve():
    comb = [[0]*(3000 + 1) for i in range(3000 + 1)]

    for n in range(3000 + 1):
        comb[n][0] = 1

        for k in range(1, n // 2 + 1):
            comb[n][k] = min(inf, comb[n - 1][min(k, n - 1 - k)]
                                    + comb[n - 1][min(k - 1, n - k)])
            
    Q = int(stdin.readline())

    for q in range(Q):
        d, x, t = map(int, stdin.readline().split())
        c = comb[x + d - 1][min(d - 1, x)]

        if c > t:
            print('ZETUBOU')
        else:
            print('AC')

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