結果

問題 No.356 円周上を回る3つの動点の一致
コンテスト
ユーザー norioc
提出日時 2025-12-26 03:20:47
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 172 ms / 5,000 ms
+ 971µs
コード長 433 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 238 ms
コンパイル使用メモリ 96,356 KB
実行使用メモリ 91,432 KB
最終ジャッジ日時 2026-07-19 19:40:42
合計ジャッジ時間 11,389 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import gcd, lcm
from fractions import Fraction as Frac

a = int(input())
b = int(input())
c = int(input())

x = Frac(a * b, abs(a - b))
y = Frac(a * c, abs(a - c))


def lcm_frac(a: Frac, b: Frac) -> Frac:
    n1, d1 = a.numerator, a.denominator
    n2, d2 = b.numerator, b.denominator
    num = lcm(n1, n2)
    den = gcd(d1, d2)
    return Frac(num, den)


ans = lcm_frac(x, y)
print(f'{ans.numerator}/{ans.denominator}')
0