結果

問題 No.416 旅行会社
ユーザー masa
提出日時 2016-08-26 23:20:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 66,456 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-08 09:51:26
合計ジャッジ時間 1,875 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0