結果
| 問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2020-05-29 21:37:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 447 bytes |
| コンパイル時間 | 852 ms |
| コンパイル使用メモリ | 88,864 KB |
| 最終ジャッジ日時 | 2025-01-10 16:41:49 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;
template <class T>
void chmax(T &a, T b) {
if (b > a) a = b;
}
int main() {
int n;
cin >> n;
int a = 0;
for (int i = 1; i * i <= n; i++) {
if (n % (i * i) == 0) chmax(a, i);
}
cout << a << ' ' << n / (a * a) << endl;
return 0;
}
merom686