結果

問題 No.300 平方数
ユーザー nmnmnmnmnmnmnmnmnmnmnmnmnmnm
提出日時 2015-11-13 22:41:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 114 ms / 1,000 ms
コード長 362 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 37,808 KB
最終ジャッジ日時 2023-10-11 15:57:24
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,972 KB
testcase_01 AC 11 ms
6,056 KB
testcase_02 AC 60 ms
21,028 KB
testcase_03 AC 12 ms
6,112 KB
testcase_04 AC 12 ms
6,132 KB
testcase_05 AC 12 ms
6,100 KB
testcase_06 AC 12 ms
5,964 KB
testcase_07 AC 12 ms
6,052 KB
testcase_08 AC 12 ms
6,220 KB
testcase_09 AC 12 ms
6,056 KB
testcase_10 AC 11 ms
6,116 KB
testcase_11 AC 11 ms
6,200 KB
testcase_12 AC 12 ms
6,272 KB
testcase_13 AC 114 ms
37,680 KB
testcase_14 AC 12 ms
6,156 KB
testcase_15 AC 38 ms
13,988 KB
testcase_16 AC 45 ms
15,932 KB
testcase_17 AC 13 ms
6,600 KB
testcase_18 AC 14 ms
6,892 KB
testcase_19 AC 49 ms
17,584 KB
testcase_20 AC 34 ms
12,644 KB
testcase_21 AC 110 ms
37,808 KB
testcase_22 AC 100 ms
34,024 KB
testcase_23 AC 27 ms
10,528 KB
testcase_24 AC 41 ms
14,648 KB
testcase_25 AC 94 ms
31,568 KB
testcase_26 AC 39 ms
14,160 KB
testcase_27 AC 64 ms
22,016 KB
testcase_28 AC 93 ms
31,176 KB
testcase_29 AC 78 ms
26,360 KB
testcase_30 AC 80 ms
26,832 KB
testcase_31 AC 81 ms
27,408 KB
testcase_32 AC 71 ms
24,596 KB
testcase_33 AC 47 ms
16,484 KB
testcase_34 AC 104 ms
34,080 KB
testcase_35 AC 72 ms
24,376 KB
testcase_36 AC 62 ms
21,284 KB
testcase_37 AC 54 ms
18,308 KB
testcase_38 AC 60 ms
21,072 KB
testcase_39 AC 66 ms
22,608 KB
testcase_40 AC 60 ms
20,524 KB
testcase_41 AC 44 ms
15,568 KB
testcase_42 AC 71 ms
24,188 KB
testcase_43 AC 29 ms
10,856 KB
testcase_44 AC 63 ms
21,488 KB
testcase_45 AC 48 ms
17,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def p_decom(n):
  ret = []
  while n % 2 == 0:
    ret.append(2)
    n /= 2
  for i in range(2, int(math.sqrt(n))+1):
    while n % i == 0:
      ret.append(i)
      n /= i
  if n > 1:
    ret.append(n)
  return ret

a = p_decom(input())
se = set(a)
b = list(se)
ans = 1
for i in range(len(b)):
    ans *= b[i] if a.count(b[i])%2==1 else 1
print ans
0