結果

問題 No.356 円周上を回る3つの動点の一致
コンテスト
ユーザー rpy3cpp
提出日時 2016-04-03 02:22:56
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 99 ms / 5,000 ms
コード長 334 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 562 ms
コンパイル使用メモリ 20,572 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-04-03 16:28:10
合計ジャッジ時間 7,110 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import gcd

t1 = int(input())
t2 = int(input())
t3 = int(input())
LCM12 = t1 * t2 // gcd(t1, t2)
LCM123 = LCM12 * t3 // gcd(LCM12, t3)
n1 = LCM123//t1
n2 = LCM123//t2
n3 = LCM123//t3

d = 1
for i in range(2, t3 + 1):
    if n1 % i == n2 % i == n3 % i:
        d = i
p = gcd(LCM123, d)
print('{}/{}'.format(LCM123//p, d//p))
0