結果

問題 No.300 平方数
ユーザー ayame_pyayame_py
提出日時 2015-11-13 23:42:08
言語 Python2
(2.7.18)
結果
AC  
実行時間 197 ms / 1,000 ms
コード長 356 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 6,668 KB
実行使用メモリ 37,708 KB
最終ジャッジ日時 2023-10-11 16:59:36
合計ジャッジ時間 5,571 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,896 KB
testcase_01 AC 11 ms
5,932 KB
testcase_02 AC 97 ms
27,452 KB
testcase_03 AC 11 ms
6,076 KB
testcase_04 AC 11 ms
5,860 KB
testcase_05 AC 12 ms
5,936 KB
testcase_06 AC 12 ms
5,992 KB
testcase_07 AC 11 ms
5,940 KB
testcase_08 AC 11 ms
5,924 KB
testcase_09 AC 11 ms
5,848 KB
testcase_10 AC 11 ms
6,068 KB
testcase_11 AC 11 ms
6,108 KB
testcase_12 AC 13 ms
6,236 KB
testcase_13 AC 139 ms
37,708 KB
testcase_14 AC 23 ms
8,864 KB
testcase_15 AC 76 ms
21,988 KB
testcase_16 AC 69 ms
19,940 KB
testcase_17 AC 138 ms
37,552 KB
testcase_18 AC 22 ms
8,192 KB
testcase_19 AC 60 ms
17,452 KB
testcase_20 AC 42 ms
12,484 KB
testcase_21 AC 138 ms
37,708 KB
testcase_22 AC 122 ms
33,664 KB
testcase_23 AC 126 ms
32,080 KB
testcase_24 AC 102 ms
23,512 KB
testcase_25 AC 116 ms
31,644 KB
testcase_26 AC 135 ms
29,144 KB
testcase_27 AC 95 ms
21,984 KB
testcase_28 AC 112 ms
31,092 KB
testcase_29 AC 197 ms
34,756 KB
testcase_30 AC 135 ms
35,372 KB
testcase_31 AC 141 ms
36,392 KB
testcase_32 AC 91 ms
24,416 KB
testcase_33 AC 54 ms
16,248 KB
testcase_34 AC 125 ms
34,000 KB
testcase_35 AC 87 ms
24,292 KB
testcase_36 AC 123 ms
27,652 KB
testcase_37 AC 108 ms
23,464 KB
testcase_38 AC 96 ms
27,008 KB
testcase_39 AC 108 ms
29,532 KB
testcase_40 AC 96 ms
26,492 KB
testcase_41 AC 70 ms
15,344 KB
testcase_42 AC 86 ms
24,260 KB
testcase_43 AC 127 ms
33,948 KB
testcase_44 AC 101 ms
27,980 KB
testcase_45 AC 58 ms
16,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import math
X=int(raw_input())
N=int(X)
prime = 1
ans = 1
while(N!=1):
	tempprime = 1
	for i in range(2,int(math.sqrt(N))+2):
		if(N%i==0):
			prime = 0
			tempprime = 0
			count = 0
			while(N%i==0):
				N/=i
				count+=1
			#print i, count
			ans*=i**(count%2)
	if tempprime == 1:
		ans*=N
		break

if prime == 1: print X
else: print ans
0