結果
問題 | No.141 魔法少女コバ |
ユーザー |
![]() |
提出日時 | 2016-03-14 13:11:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 449 ms / 5,000 ms |
コード長 | 518 bytes |
コンパイル時間 | 557 ms |
コンパイル使用メモリ | 58,884 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-01 05:11:32 |
合計ジャッジ時間 | 4,557 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 93 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;#define RREP(i,s,e) for (i = e-1; i >= s; i--)#define rrep(i,n) RREP(i,0,n)#define REP(i,s,e) for (i = s; i < e; i++)#define rep(i,n) REP(i,0,n)#define INF 1e8typedef long long ll;int solve(int a, int b) {if (a == b)return 0;else if (b > a)return 1 + solve(b,a);elsereturn 1 + solve(a-b,b);}int main() {int m, n;cin >> m >> n;cout << solve(m,n) << endl;return 0;}