結果
問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
ユーザー |
|
提出日時 | 2020-05-31 04:36:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 399 bytes |
コンパイル時間 | 1,226 ms |
コンパイル使用メモリ | 92,612 KB |
最終ジャッジ日時 | 2025-01-10 19:57:13 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <numeric> #include <math.h> using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; int res=n; for(int i=1;i*i<=n;i++){ if(n%(i*i)==0){ res=min(res,n/i/i); } } printf("%d %d\n",(int)sqrt(n/res),res); }