結果

問題 No.300 平方数
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-27 18:39:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 59,492 KB
最終ジャッジ日時 2024-04-09 18:21:50
合計ジャッジ時間 3,823 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,692 KB
testcase_01 AC 39 ms
52,320 KB
testcase_02 AC 53 ms
58,700 KB
testcase_03 AC 39 ms
52,420 KB
testcase_04 AC 37 ms
52,860 KB
testcase_05 AC 37 ms
53,080 KB
testcase_06 AC 37 ms
53,800 KB
testcase_07 AC 38 ms
53,264 KB
testcase_08 AC 37 ms
53,064 KB
testcase_09 AC 37 ms
53,032 KB
testcase_10 AC 37 ms
53,172 KB
testcase_11 AC 37 ms
54,080 KB
testcase_12 AC 39 ms
58,244 KB
testcase_13 AC 53 ms
57,940 KB
testcase_14 AC 41 ms
58,060 KB
testcase_15 AC 46 ms
58,200 KB
testcase_16 AC 45 ms
57,464 KB
testcase_17 AC 53 ms
57,932 KB
testcase_18 AC 41 ms
58,404 KB
testcase_19 AC 45 ms
58,260 KB
testcase_20 AC 43 ms
57,712 KB
testcase_21 AC 54 ms
57,436 KB
testcase_22 AC 52 ms
58,584 KB
testcase_23 AC 52 ms
58,548 KB
testcase_24 AC 47 ms
57,724 KB
testcase_25 AC 51 ms
57,756 KB
testcase_26 AC 50 ms
58,000 KB
testcase_27 AC 46 ms
57,920 KB
testcase_28 AC 51 ms
58,372 KB
testcase_29 AC 53 ms
58,244 KB
testcase_30 AC 52 ms
58,152 KB
testcase_31 AC 53 ms
58,376 KB
testcase_32 AC 48 ms
57,788 KB
testcase_33 AC 43 ms
57,640 KB
testcase_34 AC 53 ms
57,636 KB
testcase_35 AC 48 ms
58,608 KB
testcase_36 AC 49 ms
57,988 KB
testcase_37 AC 48 ms
59,492 KB
testcase_38 AC 49 ms
57,116 KB
testcase_39 AC 50 ms
58,412 KB
testcase_40 AC 49 ms
58,388 KB
testcase_41 AC 44 ms
59,104 KB
testcase_42 AC 49 ms
58,420 KB
testcase_43 AC 53 ms
58,324 KB
testcase_44 AC 50 ms
57,576 KB
testcase_45 AC 44 ms
57,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factorization(n):  # 素因数分解
    res = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            res.append((i, cnt))
    if n > 1:
        res.append((n, 1))
    return res


x = int(input())
pf = prime_factorization(x)
ans = 1
for p, f in pf:
    if f % 2 == 1:
        ans *= p
print(ans)
0