結果

問題 No.136 Yet Another GCD Problem
ユーザー hotpepsihotpepsi
提出日時 2015-01-25 23:47:30
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 705 ms
コンパイル使用メモリ 60,596 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 03:01:02
合計ジャッジ時間 1,488 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <sstream>
#include <list>

using namespace std;

int main(int argc, char *argv[])
{
	int N, K;
	string s;
	getline(cin, s);
	stringstream ss(s);
	ss >> N >> K;
	int ans = 1;
	for (int i = K; i <= N; ++i) {
		if ((N % i) == 0) {
			ans = N / i;
			break;
		}
	}
	cout << ans << endl;
	return 0;
}
0