結果
| 問題 |
No.1794 Continued Fraction
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-23 00:44:43 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 235 bytes |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-16 20:57:26 |
| 合計ジャッジ時間 | 4,083 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 RE * 11 |
ソースコード
n, m = map(int, input().split())
if m == 1:
print(n)
exit()
ANS = []
q, r = divmod(n, m)
ANS.append(q)
n = r
while n != 1:
q, r = divmod(m, n)
ANS.append(q)
n, m = r, n
ANS.append(m)
print(*ANS)