結果

問題 No.3633 Rabbit and turtle
コンテスト
ユーザー p-adic
提出日時 2026-08-21 21:54:59
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 297 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 243 ms
コンパイル使用メモリ 95,980 KB
実行使用メモリ 90,240 KB
最終ジャッジ日時 2026-08-21 21:55:04
合計ジャッジ時間 4,763 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:6: SyntaxWarning: invalid decimal literal
  if d:O("rabbit"if d>0else"turtle")

ソースコード

diff #
raw source code

from math import gcd as g
J=lambda:map(int,input().split())
O=print
for t in[0]*sum(J()):
	A,B,D,R=J();l=D*R//g(D,R);s=l//D;t=s+l//R;d=s*A-t*B
	if d:O("rabbit"if d>0else"turtle")
	else:
		r=pow(10,100,t)
		s=(r*B+A-1)//A
		t=s+(s*D-1)//R
		if r<t:O("turtle")
		else:O("rabbit"if s*A>r*B else"tie")
0