結果
| 問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-29 21:44:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 619 bytes |
| コンパイル時間 | 782 ms |
| コンパイル使用メモリ | 84,268 KB |
| 最終ジャッジ日時 | 2025-01-10 16:50:42 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define int long long
constexpr int INF = 1000000000 + 8;
signed main() {
cin.tie(0);
ios::sync_with_stdio(0);
int n;
cin >> n;
pair<int, int> ans = {INF, INF};
for (int a = 1;; a++) {
if (a * a > n) break;
if (n % (a * a)) continue;
const int b = n / a / a;
if (b < ans.second) {
ans = {a, b};
}
}
cout << ans.first << " " << ans.second << endl;
}