結果

問題 No.36 素数が嫌い!
ユーザー 👑 KazunKazun
提出日時 2020-09-02 00:42:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 231 ms / 5,000 ms
コード長 579 bytes
コンパイル時間 655 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 75,644 KB
最終ジャッジ日時 2023-08-13 08:25:44
合計ジャッジ時間 4,711 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
75,384 KB
testcase_01 AC 77 ms
75,328 KB
testcase_02 AC 74 ms
71,200 KB
testcase_03 AC 73 ms
71,452 KB
testcase_04 AC 74 ms
71,352 KB
testcase_05 AC 76 ms
75,516 KB
testcase_06 AC 75 ms
75,196 KB
testcase_07 AC 76 ms
75,312 KB
testcase_08 AC 72 ms
71,432 KB
testcase_09 AC 73 ms
71,340 KB
testcase_10 AC 75 ms
75,204 KB
testcase_11 AC 127 ms
75,388 KB
testcase_12 AC 231 ms
75,496 KB
testcase_13 AC 228 ms
75,456 KB
testcase_14 AC 76 ms
75,368 KB
testcase_15 AC 71 ms
71,292 KB
testcase_16 AC 72 ms
71,172 KB
testcase_17 AC 70 ms
71,152 KB
testcase_18 AC 75 ms
71,172 KB
testcase_19 AC 83 ms
75,644 KB
testcase_20 AC 81 ms
75,460 KB
testcase_21 AC 95 ms
75,372 KB
testcase_22 AC 80 ms
75,512 KB
testcase_23 AC 78 ms
75,388 KB
testcase_24 AC 99 ms
75,244 KB
testcase_25 AC 104 ms
75,508 KB
testcase_26 AC 130 ms
75,452 KB
testcase_27 AC 78 ms
75,320 KB
testcase_28 AC 130 ms
75,472 KB
testcase_29 AC 78 ms
75,448 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