結果

問題 No.229 線分上を往復する3つの動点の一致
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-06-21 19:10:39
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 464 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 6,444 KB
実行使用メモリ 7,808 KB
最終ジャッジ日時 2023-09-21 22:50:31
合計ジャッジ時間 3,440 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 23 ms
7,788 KB
testcase_02 AC 24 ms
7,764 KB
testcase_03 AC 23 ms
7,788 KB
testcase_04 AC 23 ms
7,680 KB
testcase_05 AC 24 ms
7,652 KB
testcase_06 AC 23 ms
7,764 KB
testcase_07 AC 29 ms
7,756 KB
testcase_08 AC 28 ms
7,572 KB
testcase_09 AC 24 ms
7,648 KB
testcase_10 AC 28 ms
7,788 KB
testcase_11 AC 29 ms
7,764 KB
testcase_12 AC 29 ms
7,704 KB
testcase_13 AC 28 ms
7,764 KB
testcase_14 AC 28 ms
7,780 KB
testcase_15 AC 28 ms
7,596 KB
testcase_16 AC 28 ms
7,616 KB
testcase_17 AC 28 ms
7,664 KB
testcase_18 AC 27 ms
7,568 KB
testcase_19 AC 26 ms
7,596 KB
testcase_20 AC 25 ms
7,648 KB
testcase_21 AC 29 ms
7,624 KB
testcase_22 AC 27 ms
7,652 KB
testcase_23 AC 29 ms
7,784 KB
testcase_24 AC 29 ms
7,784 KB
testcase_25 AC 28 ms
7,736 KB
testcase_26 AC 28 ms
7,784 KB
testcase_27 AC 25 ms
7,808 KB
testcase_28 AC 28 ms
7,804 KB
testcase_29 AC 28 ms
7,668 KB
testcase_30 AC 27 ms
7,784 KB
testcase_31 AC 26 ms
7,660 KB
testcase_32 AC 28 ms
7,664 KB
testcase_33 AC 25 ms
7,596 KB
testcase_34 AC 26 ms
7,704 KB
testcase_35 AC 29 ms
7,792 KB
testcase_36 AC 28 ms
7,760 KB
testcase_37 AC 27 ms
7,704 KB
testcase_38 AC 27 ms
7,704 KB
testcase_39 AC 25 ms
7,796 KB
testcase_40 AC 29 ms
7,584 KB
testcase_41 AC 29 ms
7,596 KB
testcase_42 AC 26 ms
7,620 KB
testcase_43 AC 27 ms
7,568 KB
testcase_44 AC 28 ms
7,656 KB
testcase_45 AC 27 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from fractions import gcd, Fraction
lcm = lambda a, b: a * b / gcd(a, b)
lcmx = lambda arr: reduce(lcm, arr)

ts = map(int, (raw_input() for _ in xrange(3)))
lm = lcmx(ts)
vs = map(lambda t: lm / t, ts)
for d in reversed(xrange(1, max(ts)/2+1)):
    r1, r2, r3 = map(lambda v: v % d, vs)
    if r1 == r2 or r1 == d-r2:
        if r1 == r3 or r1 == d-r3:
            break
res = Fraction(lm, d)
print '{}/{}'.format(res.numerator, res.denominator)
0