結果

問題 No.36 素数が嫌い!
ユーザー 👑 KazunKazun
提出日時 2020-09-02 00:42:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,912 KB
実行使用メモリ 59,404 KB
最終ジャッジ日時 2024-05-01 02:04:43
合計ジャッジ時間 2,705 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 34 ms
52,008 KB
testcase_03 AC 33 ms
52,260 KB
testcase_04 AC 32 ms
53,828 KB
testcase_05 AC 35 ms
58,064 KB
testcase_06 AC 37 ms
57,796 KB
testcase_07 AC 38 ms
57,988 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 79 ms
58,208 KB
testcase_12 AC 161 ms
57,884 KB
testcase_13 AC 162 ms
59,232 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 33 ms
52,480 KB
testcase_17 AC 33 ms
53,780 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 82 ms
58,052 KB
testcase_27 AC 39 ms
58,120 KB
testcase_28 AC 81 ms
57,816 KB
testcase_29 AC 38 ms
58,400 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
#================================================
N=int(input())

if N==1:
    print("NO")
    exit()

R=Prime_Factorization(N)

A=0
for _,e in R:
    A+=e

if A<=2:
    print("NO")
else:
    print("Yes")
0