結果
| 問題 |
No.141 魔法少女コバ
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-02-10 03:11:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 242 bytes |
| コンパイル時間 | 662 ms |
| コンパイル使用メモリ | 54,232 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 16:55:34 |
| 合計ジャッジ時間 | 2,692 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 93 |
ソースコード
#include <iostream>
using namespace std;
int func(int m, int n)
{
if (m==0 or n==0) return 0;
if (m>=n) return m/n+func(m%n, n);
return 1+func(n, m);
}
int main()
{
int m, n;
while (cin>>m>>n) cout<<func(m, n)-1<<endl;
}
hogeover30