結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2015-01-25 23:54:24 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 346 bytes |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 60,788 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 03:01:53 |
| 合計ジャッジ時間 | 1,361 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
#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 = 2; i <= N; ++i) {
if ((N % i) == 0) {
ans = max(ans, N / i);
}
}
cout << ans << endl;
return 0;
}
hotpepsi