結果
| 問題 | No.141 魔法少女コバ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-14 19:26:30 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 477 bytes |
| 記録 | |
| コンパイル時間 | 1,422 ms |
| コンパイル使用メモリ | 173,704 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-20 16:30:18 |
| 合計ジャッジ時間 | 18,298 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 RE * 37 TLE * 1 |
ソースコード
#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;
}