結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-28 18:34:55 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 702 bytes |
| 記録 | |
| コンパイル時間 | 1,125 ms |
| コンパイル使用メモリ | 220,384 KB |
| 実行使用メモリ | 9,280 KB |
| 最終ジャッジ日時 | 2026-07-06 02:32:11 |
| 合計ジャッジ時間 | 3,922 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)s; i < (int)e; i++)
#define all(a) (a).begin(), (a).end()
vector<ll> enum_divisors(ll n) {
vector<ll> res;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
res.push_back(i);
if (n / i != i) res.push_back(n / i);
}
}
sort(res.begin(), res.end());
return res;
}
int main() {
cin.tie(nullptr);
ll N;
cin >> N;
vector<ll> divs = enum_divisors(N);
int i = 0;
while (true) {
if (divs[i] >= 3) {
cout << divs[i] << '\n';
return 0;
}
i++;
}
}