結果
問題 | No.3020 ユークリッドの互除法・改 |
ユーザー |
![]() |
提出日時 | 2025-02-14 21:27:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 216 bytes |
コンパイル時間 | 378 ms |
コンパイル使用メモリ | 82,572 KB |
実行使用メモリ | 53,768 KB |
最終ジャッジ日時 | 2025-02-14 21:27:56 |
合計ジャッジ時間 | 2,262 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
from math import gcda, b = map(int, input().split())c, d = map(int, input().split())g = gcd(gcd(gcd(a, b), c), d)if g == 0:print(0, 0)else:D = abs(a * d - b * c)t = D // g // gprint(g, t * g)