結果

問題 No.1063 ルートの計算 / Sqrt Calculation
ユーザー 沙耶花沙耶花
提出日時 2020-05-29 21:22:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 464 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 193,376 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-23 19:53:12
合計ジャッジ時間 5,226 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000000000000

long long get_sqrt(long long x){
	for(int i=1;i*i<=x;i++){
		if(i*i==x)return i;
	}
	return -1;
}

int main(){
	
	long long n;
	cin>>n;
	
	for(long long i=1;true;i++){
		if(n%i!=0)continue;
		long long ret = get_sqrt(n/i);
		if(ret==-1)continue;
		
		cout<<ret<<' '<<i<<endl;
		return 0;
	}
	
	return 0;
}
0