結果

問題 No.250 atetubouのzetubou
ユーザー 👑 yumechiyumechi
提出日時 2016-03-16 13:53:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,041 ms / 5,000 ms
コード長 366 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,896 KB
最終ジャッジ日時 2024-04-09 19:59:24
合計ジャッジ時間 16,280 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 746 ms
16,768 KB
testcase_01 AC 416 ms
16,768 KB
testcase_02 AC 960 ms
16,768 KB
testcase_03 AC 1,041 ms
16,896 KB
testcase_04 AC 951 ms
16,768 KB
testcase_05 AC 970 ms
16,768 KB
testcase_06 AC 833 ms
16,768 KB
testcase_07 AC 580 ms
16,896 KB
testcase_08 AC 920 ms
16,768 KB
testcase_09 AC 782 ms
16,768 KB
testcase_10 AC 974 ms
16,768 KB
testcase_11 AC 724 ms
16,768 KB
testcase_12 AC 915 ms
16,896 KB
testcase_13 AC 652 ms
16,768 KB
testcase_14 AC 350 ms
16,768 KB
testcase_15 AC 445 ms
16,768 KB
testcase_16 AC 419 ms
16,768 KB
testcase_17 AC 421 ms
16,768 KB
testcase_18 AC 432 ms
16,768 KB
testcase_19 AC 421 ms
16,768 KB
testcase_20 AC 347 ms
16,896 KB
testcase_21 AC 347 ms
16,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
 
def solve():
    fact = [factorial(i) for i in range(3001)]

    for i in range(int(input())):
        d, x, t = map(int, input().split())
        n = (d + x - 1)
        r = x if (n//2 > x) else (n - x)
        ans = fact[n] // (fact[n - r] * fact[r])
        print("AC" if ans <= t else "ZETUBOU")

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