結果

問題 No.300 平方数
ユーザー 👑 KazunKazun
提出日時 2020-08-31 14:24:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 519 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 81,912 KB
実行使用メモリ 58,868 KB
最終ジャッジ日時 2024-04-27 18:17:06
合計ジャッジ時間 2,894 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,276 KB
testcase_01 AC 34 ms
52,684 KB
testcase_02 AC 35 ms
58,068 KB
testcase_03 AC 31 ms
53,656 KB
testcase_04 AC 32 ms
52,632 KB
testcase_05 AC 31 ms
52,476 KB
testcase_06 AC 31 ms
53,084 KB
testcase_07 AC 32 ms
52,760 KB
testcase_08 AC 31 ms
52,244 KB
testcase_09 AC 32 ms
53,160 KB
testcase_10 AC 31 ms
53,564 KB
testcase_11 AC 33 ms
52,476 KB
testcase_12 AC 33 ms
52,352 KB
testcase_13 AC 48 ms
57,328 KB
testcase_14 AC 31 ms
53,272 KB
testcase_15 AC 32 ms
52,896 KB
testcase_16 AC 32 ms
53,224 KB
testcase_17 AC 31 ms
53,416 KB
testcase_18 AC 31 ms
52,928 KB
testcase_19 AC 31 ms
53,500 KB
testcase_20 AC 34 ms
57,532 KB
testcase_21 AC 31 ms
52,740 KB
testcase_22 AC 31 ms
52,836 KB
testcase_23 AC 34 ms
57,000 KB
testcase_24 AC 36 ms
58,476 KB
testcase_25 AC 43 ms
58,340 KB
testcase_26 AC 37 ms
57,384 KB
testcase_27 AC 37 ms
57,652 KB
testcase_28 AC 45 ms
58,660 KB
testcase_29 AC 43 ms
57,768 KB
testcase_30 AC 34 ms
57,600 KB
testcase_31 AC 35 ms
57,748 KB
testcase_32 AC 34 ms
57,480 KB
testcase_33 AC 39 ms
58,156 KB
testcase_34 AC 46 ms
58,216 KB
testcase_35 AC 41 ms
57,548 KB
testcase_36 AC 37 ms
57,652 KB
testcase_37 AC 37 ms
58,792 KB
testcase_38 AC 35 ms
58,116 KB
testcase_39 AC 34 ms
58,868 KB
testcase_40 AC 35 ms
57,796 KB
testcase_41 AC 37 ms
58,172 KB
testcase_42 AC 33 ms
52,804 KB
testcase_43 AC 34 ms
57,208 KB
testcase_44 AC 34 ms
58,108 KB
testcase_45 AC 35 ms
58,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#素因数分解
def Prime_Factorization(N):
    if N<0:
        R=[[-1,1]]
    else:
        R=[]

    N=abs(N)
    k=2
    while k*k<=N:
        if N%k==0:
            C=0
            while N%k==0:
                C+=1
                N//=k
            R.append([k,C])
        k+=1

    if N!=1:
        R.append([N,1])
    if not R:
        R.append([N,1])

    return R
#================================================
X=int(input())
R=Prime_Factorization(X)

Y=1
for (p,e) in R:
    if e%2:
        Y*=p

print(Y)
0