結果
| 問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
| コンテスト | |
| ユーザー |
udonman
|
| 提出日時 | 2020-05-29 21:25:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,284 bytes |
| コンパイル時間 | 912 ms |
| コンパイル使用メモリ | 91,444 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 02:23:04 |
| 合計ジャッジ時間 | 1,507 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <iomanip>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};
ll INF = (1 << 30);
ll MOD = 1e9 + 7;
vector<int> par;
vector<int> RANK;
void init(int n){
for(int i = 0; i < n; i++){
par.pb(i);
RANK.pb(0);
}return;
}
int FindRoot(int x){
if(par[x] == x) return x;
par[x] = FindRoot(par[x]);
return par[x];
}
bool isSame(int x, int y){
return FindRoot(x) == FindRoot(y);
}
void Union(int x, int y) {
x = FindRoot(x);
y = FindRoot(y);
if (x == y) return;
if (RANK[x] > RANK[y]) par[y] = x;
else {
par[x] = y;
if (RANK[x] == RANK[y]) {
RANK[y]++;
}
}
return;
}
int main() {
ll n; cin >> n;
ll b = n;
for(ll i = 1; i * i <= n; i++){
if(n % (i * i) == 0){
b = min(b,n / (i * i));
}
}
cout << sqrt(n / b) << " " << b << endl;
}
udonman