結果
問題 |
No.141 魔法少女コバ
|
ユーザー |
|
提出日時 | 2020-04-12 05:47:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 5,000 ms |
コード長 | 439 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 65,792 KB |
最終ジャッジ日時 | 2025-01-09 17:38:40 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 93 |
ソースコード
#include <iostream> using lint = long long; void solve() { lint m, n; std::cin >> m >> n; int ans = 0; while (m > 0) { if (m < n) { std::swap(m, n); ++ans; } else { ans += m / n; m %= n; } } std::cout << ans - 1 << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }