結果
| 問題 |
No.3020 ユークリッドの互除法・改
|
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-02-14 21:54:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 253 bytes |
| コンパイル時間 | 152 ms |
| コンパイル使用メモリ | 82,320 KB |
| 実行使用メモリ | 53,828 KB |
| 最終ジャッジ日時 | 2025-02-14 21:55:29 |
| 合計ジャッジ時間 | 2,032 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
a,b=map(int, input().split())
c,d=map(int, input().split())
import math
e=abs(a*d-c*b)
if a==0 and b==0 and c==0 and d==0:
print(0,0)
exit()
A=[a,b,c,d]
for a in A:
if a!=0:
s=a
import math
for a in A:
s=math.gcd(a,s)
print(s,e//s)
timi