結果

問題 No.300 平方数
ユーザー nohakai3nohakai3
提出日時 2022-11-04 20:47:40
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 452 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 75,984 KB
最終ジャッジ日時 2023-09-25 22:56:48
合計ジャッジ時間 6,125 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,552 KB
testcase_01 AC 71 ms
71,704 KB
testcase_02 AC 82 ms
75,968 KB
testcase_03 AC 67 ms
71,120 KB
testcase_04 AC 72 ms
71,540 KB
testcase_05 AC 67 ms
71,600 KB
testcase_06 AC 70 ms
71,708 KB
testcase_07 AC 69 ms
71,636 KB
testcase_08 AC 69 ms
71,836 KB
testcase_09 AC 70 ms
71,708 KB
testcase_10 AC 70 ms
71,712 KB
testcase_11 AC 73 ms
71,636 KB
testcase_12 AC 73 ms
75,556 KB
testcase_13 AC 92 ms
75,828 KB
testcase_14 AC 75 ms
75,344 KB
testcase_15 AC 80 ms
75,632 KB
testcase_16 AC 79 ms
75,512 KB
testcase_17 AC 89 ms
75,712 KB
testcase_18 AC 75 ms
75,344 KB
testcase_19 AC 79 ms
75,468 KB
testcase_20 AC 77 ms
75,388 KB
testcase_21 AC 89 ms
75,492 KB
testcase_22 AC 86 ms
75,560 KB
testcase_23 AC 87 ms
75,632 KB
testcase_24 AC 83 ms
75,812 KB
testcase_25 AC 85 ms
75,428 KB
testcase_26 AC 83 ms
75,712 KB
testcase_27 AC 80 ms
75,540 KB
testcase_28 AC 85 ms
75,568 KB
testcase_29 AC 88 ms
75,580 KB
testcase_30 AC 89 ms
75,460 KB
testcase_31 AC 89 ms
75,504 KB
testcase_32 AC 83 ms
75,580 KB
testcase_33 AC 77 ms
75,580 KB
testcase_34 AC 89 ms
75,704 KB
testcase_35 AC 82 ms
75,712 KB
testcase_36 AC 83 ms
75,596 KB
testcase_37 AC 81 ms
75,580 KB
testcase_38 AC 83 ms
75,984 KB
testcase_39 AC 87 ms
75,548 KB
testcase_40 AC 82 ms
75,576 KB
testcase_41 AC 78 ms
75,544 KB
testcase_42 AC 81 ms
75,424 KB
testcase_43 AC 86 ms
75,620 KB
testcase_44 AC 86 ms
75,740 KB
testcase_45 AC 80 ms
75,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(n):
    arr = []
    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.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
n=int(input())
l=factorization(n)
ans=1
for x in l:
    if x[1]%2==1:
        ans*=x[0]

print(ans) 
0