結果

問題 No.300 平方数
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-11-17 22:35:45
言語 Python2
(2.7.18)
結果
AC  
実行時間 116 ms / 1,000 ms
コード長 414 bytes
コンパイル時間 590 ms
コンパイル使用メモリ 6,596 KB
実行使用メモリ 6,512 KB
最終ジャッジ日時 2023-10-11 17:54:51
合計ジャッジ時間 3,593 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
6,260 KB
testcase_01 AC 13 ms
6,440 KB
testcase_02 AC 14 ms
6,504 KB
testcase_03 AC 13 ms
6,344 KB
testcase_04 AC 13 ms
6,312 KB
testcase_05 AC 13 ms
6,288 KB
testcase_06 AC 13 ms
6,248 KB
testcase_07 AC 14 ms
6,260 KB
testcase_08 AC 13 ms
6,340 KB
testcase_09 AC 13 ms
6,252 KB
testcase_10 AC 14 ms
6,512 KB
testcase_11 AC 14 ms
6,340 KB
testcase_12 AC 13 ms
6,244 KB
testcase_13 AC 116 ms
6,252 KB
testcase_14 AC 14 ms
6,332 KB
testcase_15 AC 13 ms
6,312 KB
testcase_16 AC 13 ms
6,332 KB
testcase_17 AC 13 ms
6,292 KB
testcase_18 AC 13 ms
6,440 KB
testcase_19 AC 14 ms
6,328 KB
testcase_20 AC 17 ms
6,288 KB
testcase_21 AC 14 ms
6,388 KB
testcase_22 AC 14 ms
6,336 KB
testcase_23 AC 22 ms
6,292 KB
testcase_24 AC 31 ms
6,388 KB
testcase_25 AC 97 ms
6,244 KB
testcase_26 AC 41 ms
6,240 KB
testcase_27 AC 31 ms
6,392 KB
testcase_28 AC 95 ms
6,248 KB
testcase_29 AC 80 ms
6,380 KB
testcase_30 AC 19 ms
6,244 KB
testcase_31 AC 20 ms
6,512 KB
testcase_32 AC 19 ms
6,440 KB
testcase_33 AC 48 ms
6,308 KB
testcase_34 AC 105 ms
6,324 KB
testcase_35 AC 74 ms
6,252 KB
testcase_36 AC 36 ms
6,496 KB
testcase_37 AC 38 ms
6,444 KB
testcase_38 AC 14 ms
6,312 KB
testcase_39 AC 14 ms
6,472 KB
testcase_40 AC 14 ms
6,248 KB
testcase_41 AC 32 ms
6,256 KB
testcase_42 AC 13 ms
6,328 KB
testcase_43 AC 15 ms
6,288 KB
testcase_44 AC 15 ms
6,292 KB
testcase_45 AC 14 ms
6,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from collections import defaultdict
from operator import mul

def factorize(n):
    res = defaultdict(int)
    d = 2
    while d * d <= n:
        while n % d == 0:
            res[d] += 1
            n /= d
        d += 1
    if n > 1:
        res[n] += 1
    return res

x = int(raw_input())
filtered = [k for k, v in factorize(x).items() if v & 1] or [1]
res = reduce(mul, filtered)
print res
0