結果
問題 |
No.414 衝動
|
ユーザー |
|
提出日時 | 2024-11-04 01:28:53 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 13 ms / 1,000 ms |
コード長 | 680 bytes |
コンパイル時間 | 3,342 ms |
コンパイル使用メモリ | 251,564 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-04 01:28:58 |
合計ジャッジ時間 | 4,568 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#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 M; cin >> M; if (M == 1) { cout << "1 1\n"; return 0; } vector<ll> divs = enum_divisors(M); cout << divs[1] << ' ' << divs[divs.size() - 2] << '\n'; }