結果
| 問題 | No.3020 ユークリッドの互除法・改 |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-02-14 21:54:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 253 bytes |
| 記録 | |
| コンパイル時間 | 506 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2026-07-01 08:04:31 |
| 合計ジャッジ時間 | 1,838 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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