結果

問題 No.3633 Rabbit and turtle
コンテスト
ユーザー K2
提出日時 2026-08-21 21:39:06
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 280 ms / 2,000 ms
+ 172µs
コード長 332 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 220 ms
コンパイル使用メモリ 96,360 KB
実行使用メモリ 85,000 KB
最終ジャッジ日時 2026-08-21 21:39:15
合計ジャッジ時間 3,799 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

X = 10 ** 100


for _ in range(int(input())):
    A, B, D, R = map(int, input().split())

    def calc(x: int):
        n = (x + A - 1) // A
        res = n
        res += ((n - 1) * D + R - 1) // R
        return res

    t1 = calc(B * X)
    t2 = calc(B * X + 1)
    print("rabbit" if t2 <= X else "tie" if t1 <= X else "turtle")
0