結果

問題 No.229 線分上を往復する3つの動点の一致
ユーザー mbanmban
提出日時 2017-10-14 10:15:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 753 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 94,116 KB
最終ジャッジ日時 2023-08-11 01:53:49
合計ジャッジ時間 15,829 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
93,032 KB
testcase_01 AC 291 ms
93,668 KB
testcase_02 AC 292 ms
93,384 KB
testcase_03 AC 284 ms
93,180 KB
testcase_04 AC 273 ms
93,732 KB
testcase_05 AC 311 ms
92,660 KB
testcase_06 AC 295 ms
93,712 KB
testcase_07 AC 285 ms
93,004 KB
testcase_08 WA -
testcase_09 AC 280 ms
94,060 KB
testcase_10 AC 285 ms
93,220 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 281 ms
93,316 KB
testcase_14 AC 297 ms
93,240 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 306 ms
93,620 KB
testcase_28 AC 291 ms
93,564 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 286 ms
93,668 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 297 ms
93,244 KB
testcase_36 WA -
testcase_37 AC 300 ms
93,308 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 291 ms
93,676 KB
testcase_43 AC 287 ms
93,244 KB
testcase_44 AC 292 ms
93,168 KB
testcase_45 AC 303 ms
93,044 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 or (tn * T7.denominator) % (td * T7.numerator) == 0:
        print("{0}/{1}".format(tn,td))
        break;
0