結果
問題 | No.356 円周上を回る3つの動点の一致 |
ユーザー |
|
提出日時 | 2018-07-28 19:43:03 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 251 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,440 KB |
最終ジャッジ日時 | 2024-07-06 05:30:05 |
合計ジャッジ時間 | 13,011 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 47 |
ソースコード
from math import gcd from functools import reduce from sys import stdin, stdout input = lambda: stdin.readline().rstrip() write = stdout.write def main(): T = list(map(int, stdin.read().splitlines())) lcm = lambda x, y: x * y // gcd(x, y) lcm_ = reduce(lcm, T) loop = [] for i in T: loop.append(lcm_ // i) den = 1 for i in range(1, max(loop) + 1): mod = [] for j in loop: mod.append(j % i) if mod[0] == mod[1] == mod[2]: den = i ans = str(lcm_) + '/' + str(den) + '\n' write(ans) main()