結果
| 問題 |
No.415 ぴょん
|
| ユーザー |
|
| 提出日時 | 2016-08-26 23:21:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 248 bytes |
| コンパイル時間 | 454 ms |
| コンパイル使用メモリ | 65,012 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-18 14:41:50 |
| 合計ジャッジ時間 | 1,200 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int gcd = __gcd(n,d);
n /= gcd;
d /= gcd;
int ans = n % d == 0 ? n / d : n;
ans--;
cout << ans << endl;
return 0;
}