結果

問題 No.229 線分上を往復する3つの動点の一致
ユーザー mbanmban
提出日時 2017-10-14 10:13:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 604 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 92,032 KB
最終ジャッジ日時 2024-04-28 19:03:01
合計ジャッジ時間 12,749 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 241 ms
91,500 KB
testcase_01 WA -
testcase_02 AC 239 ms
91,680 KB
testcase_03 AC 253 ms
91,392 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 232 ms
91,460 KB
testcase_10 AC 246 ms
91,264 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 230 ms
91,708 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 238 ms
91,452 KB
testcase_28 AC 214 ms
91,264 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 218 ms
91,264 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 230 ms
91,488 KB
testcase_36 WA -
testcase_37 AC 235 ms
91,364 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 222 ms
91,284 KB
testcase_43 AC 224 ms
91,392 KB
testcase_44 AC 224 ms
92,032 KB
testcase_45 AC 240 ms
91,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction

T1 = int(input())
T2 = int(input())
T3 = int(input())

T4 = 1 / (Fraction(1, T1) + Fraction(1, T2))
T5 = 1 / (Fraction(1, T1) + Fraction(1, T3))
T6 = 1 / (Fraction(1, T1) - Fraction(1, T2))
T7 = 1 / (Fraction(1, T1) - Fraction(1, T3))
time = []

for i in range(1, 10000):
    time.append(T4 * i)
    time.append(T6 * i)

time.sort()


for t in time:
    tn = t.numerator
    td = t.denominator
    if (tn * T5.denominator) % (td * T5.numerator) == 0:
        print(t)
        break;
    if (tn * T7.denominator) % (td * T7.numerator) == 0:
        print(t)
        break;
0