結果
問題 |
No.141 魔法少女コバ
|
ユーザー |
![]() |
提出日時 | 2015-07-15 03:42:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 339 ms / 5,000 ms |
コード長 | 276 bytes |
コンパイル時間 | 365 ms |
コンパイル使用メモリ | 56,408 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 07:35:40 |
合計ジャッジ時間 | 3,772 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 93 |
ソースコード
#include<iostream> #include<algorithm> using namespace std; int main(void){ int m, n; cin >> m >> n; int ans = 0; if (m == 0 || n == 0){ cout << -1 << endl; return 0; } while (n != m){ ans++; if (m >= n) m -= n; else swap(m, n); } cout << ans << endl; return 0; }