結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
haraduka_
|
| 提出日時 | 2015-01-26 00:09:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 899 bytes |
| コンパイル時間 | 1,013 ms |
| コンパイル使用メモリ | 91,152 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 03:06:37 |
| 合計ジャッジ時間 | 2,209 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 25 |
ソースコード
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<bitset>
#include<functional>
#include<utility>
#include<iterator>
#include<algorithm>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<cstring>
#include<iomanip>
using namespace std;
#define len(val) static_cast<int>(val.size())
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
typedef pair<int, int> P;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
vector<int> s;
for(int i=1; i<n; i++){
if(n%i == 0) s.push_back(i);
}
int res = 1;
for(int i=len(s)-1; i>=0; i--){
int tmp = n/s[i];
if(tmp >= k){
res = max(res, s[i]);
}
}
cout << res << endl;
}
haraduka_