結果

問題 No.300 平方数
ユーザー 双六双六
提出日時 2019-04-06 00:12:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 506 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 14,180 KB
最終ジャッジ日時 2023-09-05 06:33:43
合計ジャッジ時間 5,208 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
9,500 KB
testcase_01 AC 94 ms
9,564 KB
testcase_02 AC 94 ms
9,436 KB
testcase_03 AC 95 ms
9,504 KB
testcase_04 AC 93 ms
9,388 KB
testcase_05 AC 92 ms
9,364 KB
testcase_06 AC 92 ms
9,388 KB
testcase_07 AC 95 ms
9,368 KB
testcase_08 AC 93 ms
9,440 KB
testcase_09 AC 94 ms
9,544 KB
testcase_10 AC 93 ms
9,384 KB
testcase_11 AC 93 ms
9,536 KB
testcase_12 AC 94 ms
9,448 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

L = [1 for i in range(100001)]
L[0] = 0
L[1] = 0
plist = []
for i in range(100001):
	if L[i] == 1:
		plist.append(i)
		c = 2
		while True:
			if i * c <= 100000:
				L[i * c] = 0
				c += 1
			else:
				break

X = int(input())
D = defaultdict(int)

x = X
judge = "YES"
while judge == "YES":
	for i in plist:
		if x < i:
			judge = "NO"
		else:
			if x % i == 0:
				D[i] += 1
				x = int(x // i)
				break


ans = 1
for i in D:
	if D[i] % 2 == 1:
		ans *= i

print(ans)
0