結果

問題 No.300 平方数
ユーザー H3PO4H3PO4
提出日時 2020-06-15 09:07:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 96 ms / 1,000 ms
コード長 464 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 8,000 KB
最終ジャッジ日時 2023-09-16 10:14:16
合計ジャッジ時間 4,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 15 ms
7,924 KB
testcase_02 AC 50 ms
7,808 KB
testcase_03 AC 14 ms
7,824 KB
testcase_04 AC 16 ms
7,816 KB
testcase_05 AC 15 ms
7,876 KB
testcase_06 AC 15 ms
7,780 KB
testcase_07 AC 15 ms
7,808 KB
testcase_08 AC 14 ms
7,784 KB
testcase_09 AC 15 ms
7,780 KB
testcase_10 AC 15 ms
7,908 KB
testcase_11 AC 15 ms
7,780 KB
testcase_12 AC 15 ms
7,992 KB
testcase_13 AC 96 ms
7,856 KB
testcase_14 AC 20 ms
7,820 KB
testcase_15 AC 43 ms
7,868 KB
testcase_16 AC 38 ms
7,840 KB
testcase_17 AC 69 ms
7,788 KB
testcase_18 AC 19 ms
7,840 KB
testcase_19 AC 34 ms
7,868 KB
testcase_20 AC 27 ms
7,872 KB
testcase_21 AC 68 ms
7,852 KB
testcase_22 AC 62 ms
7,848 KB
testcase_23 AC 83 ms
7,868 KB
testcase_24 AC 61 ms
7,852 KB
testcase_25 AC 81 ms
7,928 KB
testcase_26 AC 75 ms
8,000 KB
testcase_27 AC 56 ms
7,952 KB
testcase_28 AC 80 ms
7,816 KB
testcase_29 AC 90 ms
7,780 KB
testcase_30 AC 92 ms
7,812 KB
testcase_31 AC 94 ms
7,812 KB
testcase_32 AC 63 ms
7,788 KB
testcase_33 AC 42 ms
7,888 KB
testcase_34 AC 87 ms
7,816 KB
testcase_35 AC 62 ms
8,000 KB
testcase_36 AC 71 ms
7,880 KB
testcase_37 AC 60 ms
7,780 KB
testcase_38 AC 50 ms
7,784 KB
testcase_39 AC 62 ms
7,868 KB
testcase_40 AC 56 ms
7,840 KB
testcase_41 AC 39 ms
7,820 KB
testcase_42 AC 45 ms
7,820 KB
testcase_43 AC 69 ms
7,924 KB
testcase_44 AC 59 ms
7,872 KB
testcase_45 AC 37 ms
7,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(n):
    arr = dict()
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if not arr and n != 1:
        arr[n] = 1

    return arr


X = int(input())
Y = 1
for k, v in factorization(X).items():
    if v % 2:
        Y *= k
print(Y)
0