結果

問題 No.36 素数が嫌い!
ユーザー convexineq
提出日時 2020-11-25 06:45:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 741 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 59,324 KB
最終ジャッジ日時 2024-07-23 19:12:17
合計ジャッジ時間 2,639 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factorize(N): #素因数分解
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

#a,b,c = map(int,readline().split())
n = int(input())
lst = prime_factorize(n)
ok = 0
if sum(e for p,e in lst) >= 3:
    print("YES")
else:
    print("NO")
0