結果

問題 No.1794 Continued Fraction
ユーザー qibqib
提出日時 2023-04-06 14:09:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 53,672 KB
最終ジャッジ日時 2024-04-10 11:23:58
合計ジャッジ時間 2,967 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,360 KB
testcase_01 AC 40 ms
52,608 KB
testcase_02 AC 40 ms
52,468 KB
testcase_03 AC 37 ms
52,676 KB
testcase_04 AC 37 ms
52,676 KB
testcase_05 AC 37 ms
52,308 KB
testcase_06 AC 37 ms
53,672 KB
testcase_07 AC 37 ms
52,188 KB
testcase_08 AC 38 ms
52,200 KB
testcase_09 AC 38 ms
52,252 KB
testcase_10 AC 36 ms
52,820 KB
testcase_11 AC 37 ms
52,504 KB
testcase_12 AC 37 ms
52,236 KB
testcase_13 AC 37 ms
53,092 KB
testcase_14 AC 37 ms
52,992 KB
testcase_15 AC 37 ms
53,560 KB
testcase_16 AC 37 ms
53,312 KB
testcase_17 AC 37 ms
52,620 KB
testcase_18 AC 37 ms
52,180 KB
testcase_19 AC 38 ms
52,336 KB
testcase_20 AC 36 ms
52,644 KB
testcase_21 AC 37 ms
52,748 KB
testcase_22 AC 37 ms
51,744 KB
testcase_23 AC 37 ms
52,204 KB
testcase_24 AC 37 ms
52,572 KB
testcase_25 AC 37 ms
52,776 KB
testcase_26 AC 37 ms
53,572 KB
testcase_27 AC 37 ms
52,752 KB
testcase_28 AC 37 ms
52,132 KB
testcase_29 AC 36 ms
53,308 KB
testcase_30 AC 37 ms
52,268 KB
権限があれば一括ダウンロードができます

ソースコード

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