結果

問題 No.300 平方数
ユーザー 184184
提出日時 2015-11-13 23:28:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 419 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 48,360 KB
実行使用メモリ 6,620 KB
最終ジャッジ日時 2023-10-11 16:47:59
合計ジャッジ時間 2,335 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,464 KB
testcase_01 AC 4 ms
6,468 KB
testcase_02 AC 11 ms
6,536 KB
testcase_03 AC 3 ms
6,480 KB
testcase_04 AC 4 ms
6,520 KB
testcase_05 AC 3 ms
6,540 KB
testcase_06 AC 4 ms
6,620 KB
testcase_07 AC 4 ms
6,532 KB
testcase_08 AC 4 ms
6,500 KB
testcase_09 AC 4 ms
6,480 KB
testcase_10 AC 3 ms
6,464 KB
testcase_11 AC 3 ms
6,520 KB
testcase_12 AC 4 ms
6,536 KB
testcase_13 AC 15 ms
6,528 KB
testcase_14 AC 6 ms
6,604 KB
testcase_15 AC 10 ms
6,536 KB
testcase_16 AC 9 ms
6,476 KB
testcase_17 AC 15 ms
6,480 KB
testcase_18 AC 5 ms
6,456 KB
testcase_19 AC 8 ms
6,480 KB
testcase_20 AC 6 ms
6,528 KB
testcase_21 AC 16 ms
6,472 KB
testcase_22 AC 14 ms
6,532 KB
testcase_23 AC 13 ms
6,540 KB
testcase_24 AC 10 ms
6,508 KB
testcase_25 AC 13 ms
6,520 KB
testcase_26 AC 12 ms
6,528 KB
testcase_27 AC 10 ms
6,584 KB
testcase_28 AC 12 ms
6,532 KB
testcase_29 AC 14 ms
6,564 KB
testcase_30 AC 14 ms
6,460 KB
testcase_31 AC 15 ms
6,488 KB
testcase_32 AC 10 ms
6,520 KB
testcase_33 AC 8 ms
6,536 KB
testcase_34 AC 14 ms
6,480 KB
testcase_35 AC 11 ms
6,468 KB
testcase_36 AC 11 ms
6,532 KB
testcase_37 AC 11 ms
6,572 KB
testcase_38 AC 11 ms
6,528 KB
testcase_39 AC 12 ms
6,508 KB
testcase_40 AC 11 ms
6,480 KB
testcase_41 AC 8 ms
6,536 KB
testcase_42 AC 10 ms
6,508 KB
testcase_43 AC 14 ms
6,532 KB
testcase_44 AC 12 ms
6,480 KB
testcase_45 AC 8 ms
6,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>

using namespace std;

//namaega184

int main(){
	long long x,n,ans;scanf("%lld",&x);
	n=x;
	vector<int> a(1000001,0);
	a[1]=1;
	for(long long i=2;i*i<=n;i++){
		if(x%i)continue;
		while(x%i==0){
			a[i]++;
			x/=i;
		}
	}
	ans=x;
	for(long long i=2;i*i<=n;i++){
		if(a[i]&&a[i]%2)ans*=i;
	}
	printf("%lld\n",ans);
	return 0;
}
0