結果

問題 No.1794 Continued Fraction
ユーザー chibou1111chibou1111
提出日時 2022-01-19 22:56:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 651 bytes
コンパイル時間 2,372 ms
コンパイル使用メモリ 104,128 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 20:01:25
合計ジャッジ時間 5,692 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 RE -
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 2 ms
5,376 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 RE -
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 3 ms
5,376 KB
testcase_24 RE -
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 RE -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream> 
#include <string> 
#include <utility>
#include <vector> 
#include <algorithm> 
#include <map>
#include <queue> 
#include <set>
#include <stack>
#include <iomanip>
#include <cmath>
#include <limits>
#include <complex>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
const ll INF = 1001001001001001001;
const ll MOD = 1000000007;
const ll mod = 998244353;
const int inf = 1 << 29;




int main() {
    ll n, m;
    cin >> n >> m;
    while (n > 1) {
        cout << n / m << ' ';
        ll r = n % m;
        n = m;
        m = r;
    }



    return 0;
}
0