結果

問題 No.250 atetubouのzetubou
コンテスト
ユーザー lam6er
提出日時 2025-03-20 21:15:31
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 85 ms / 5,000 ms
+ 585µs
コード長 807 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 89 ms
コンパイル使用メモリ 65,152 KB
実行使用メモリ 62,848 KB
最終ジャッジ日時 2026-10-14 01:04:26
合計ジャッジ時間 3,683 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys

def main():
    input = sys.stdin.read().split()
    Q = int(input[0])
    idx = 1
    for _ in range(Q):
        D = int(input[idx])
        X = int(input[idx+1])
        T = int(input[idx+2])
        idx +=3
        
        d = D -1
        if d == 0:
            if 1 <= T:
                print("AC")
            else:
                print("ZETUBOU")
            continue
        
        res = 1
        ok = True
        for i in range(1, d+1):
            numerator = X + i
            temp = res * numerator
            res_new = temp // i
            if res_new > T:
                ok = False
                break
            res = res_new
        
        if ok and res <= T:
            print("AC")
        else:
            print("ZETUBOU")

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