結果

問題 No.1063 ルートの計算 / Sqrt Calculation
ユーザー queee
提出日時 2020-05-29 22:28:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 810 bytes
コンパイル時間 1,011 ms
コンパイル使用メモリ 82,992 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-06 05:48:38
合計ジャッジ時間 1,728 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#pragma GCC optimize("O3")

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <functional>
#define DB puts("D")
#define pb push_back

using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18;
template<typename T, typename U, typename O> void caut(T a, U b, O c){cout<<"("<<a<<","<<b<<","<<c<<") ";}
template<typename T, typename U> void caut(T a, U b){cout<<"("<<a<<","<<b<<") ";}
template<typename T> void caut(T a){cout<<"("<<a<<") ";}
void input(int a[], int n){for(int i=0;i<n;i++) cin>>a[i];}

using P=pair<ll,ll>;
const ll M = 1e9+7;

int main() {
  int n; cin>>n;
  int k=1;
  for(int i=2;i*i<=n;i++) {
    while(n%(i*i)==0) n/=i*i,k*=i;
  }
  cout<<k<<" "<<n<<endl;
}
0