結果

問題 No.1794 Continued Fraction
ユーザー ryusuke
提出日時 2022-01-27 00:58:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 160 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 54,040 KB
最終ジャッジ日時 2024-12-23 23:06:27
合計ジャッジ時間 3,154 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())

ans = []
while True:
    if m == 0:
        break
    p = n // m
    ans.append(p)
    n -= p * m
    n, m = m, n

print(*ans)
0