結果
問題 | No.3020 ユークリッドの互除法・改 |
ユーザー |
![]() |
提出日時 | 2025-02-14 22:05:14 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 252 bytes |
コンパイル時間 | 535 ms |
コンパイル使用メモリ | 82,512 KB |
実行使用メモリ | 53,748 KB |
最終ジャッジ日時 | 2025-02-14 22:08:29 |
合計ジャッジ時間 | 1,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
A = list(map(int, input().split()))B = list(map(int, input().split()))if A == [0, 0] == B:print(0, 0)exit()ans = abs(A[0] * B[1] - A[1] * B[0])from math import gcdg = gcd(A[0], A[1])g1 = gcd(B[0], B[1])g = gcd(g, g1)print(g, ans // g)