結果
| 問題 | No.141 魔法少女コバ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-14 19:26:30 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 477 bytes |
| 記録 | |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 173,568 KB |
| 実行使用メモリ | 17,108 KB |
| 最終ジャッジ日時 | 2026-08-02 12:40:23 |
| 合計ジャッジ時間 | 13,773 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 92 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define fastcin {\
cin.tie(0);\
ios::sync_with_stdio(false);\
}
#define rep(i, a, b) for(int i = a; i < b; i++)
#define print(x) cout << x << "\n"
int main() {
fastcin;
int m, n, g, ans = 0;
cin >> m >> n;
while(n!=1) {
if(m>n) {
ans += m/n;
m %= n;
} else {
swap(m, n);
ans++;
}
}
ans += m-1;
print(ans);
return 0;
}