結果
| 問題 | No.3020 ユークリッドの互除法・改 |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2025-02-14 22:35:13 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 33 ms / 2,000 ms |
| + 395µs | |
| コード長 | 209 bytes |
| 記録 | |
| コンパイル時間 | 162 ms |
| コンパイル使用メモリ | 64,824 KB |
| 実行使用メモリ | 54,040 KB |
| 最終ジャッジ日時 | 2026-10-21 05:50:12 |
| 合計ジャッジ時間 | 2,510 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
from math import gcd
a, b = map(int, input().split())
c, d = map(int, input().split())
if [a, b, c, d].count(0) == 4:
exit(print(0, 0))
diff = abs(a*d-b*c)
print(gcd(a, b, c, d), diff//gcd(a, b, c, d))
detteiuu