結果
| 問題 | No.3020 ユークリッドの互除法・改 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-14 21:26:16 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 62 ms / 2,000 ms |
| + 787µs | |
| コード長 | 473 bytes |
| 記録 | |
| コンパイル時間 | 82 ms |
| コンパイル使用メモリ | 64,832 KB |
| 実行使用メモリ | 61,780 KB |
| 最終ジャッジ日時 | 2026-10-21 05:47:19 |
| 合計ジャッジ時間 | 3,462 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#input = sys.stdin.readline
#sys.setrecursionlimit(10**9)
#n = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
a,b = map(int,input().split())
c,d = map(int,input().split())
#for i in range(n):
# alist.append(list(map(int,input().split())))
if a == b == c == d == 0:
print(0,0)
exit()
d1 = math.gcd(a,b,c,d)
print(d1,abs(a*d - b*c)//d1)