結果
問題 |
No.136 Yet Another GCD Problem
|
ユーザー |
![]() |
提出日時 | 2015-01-25 23:48:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 499 ms |
コンパイル使用メモリ | 60,928 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 03:01:16 |
合計ジャッジ時間 | 1,799 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 25 |
ソースコード
#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 = max(ans, N / i); } } cout << ans << endl; return 0; }