結果

問題 No.1794 Continued Fraction
ユーザー qib
提出日時 2023-04-06 14:09:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-10-02 13:23:07
合計ジャッジ時間 3,276 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

ans = []
def gcd(x, y):
  if y == 0:
    return x
  else:
    ans.append(x // y)
    return gcd(y, x % y)

n, m = map(int, input().split())
_ = gcd(n, m)
print(*ans, sep=" ")
0