結果
| 問題 |
No.1794 Continued Fraction
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2021-12-23 00:01:58 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 684 bytes |
| コンパイル時間 | 2,148 ms |
| コンパイル使用メモリ | 112,496 KB |
| 最終ジャッジ日時 | 2025-01-27 05:46:32 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)
using m32 = atcoder::modint998244353;
int main() {
i64 N,M; cin >> N >> M;
vector<i64> ans;
while(M){
ans.push_back(N / M);
i64 tmp = N % M;
N = M;
M = tmp;
}
rep(i,ans.size()){ if(i) cout << " "; cout << ans[i]; }
cout << endl;
return 0;
}
struct ios_do_not_sync{
ios_do_not_sync(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
} ios_do_not_sync_instance;
Nachia