結果

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

ソースコード

diff #

#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;


void lok(){
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    int p=floor(sqrt(t));
    if(p*p==t){
    	cout<<p<<" 1"<<endl;
    	return 0;
    }
    while(true){
    	p--;
    	if(t%(p*p)==0){
    		cout<<p<<' '<<t/(p*p)<<endl;
    		break;
    	}
    }
	return 0;
}
0