結果

問題 No.36 素数が嫌い!
ユーザー ntuda
提出日時 2023-12-27 23:40:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 60,556 KB
最終ジャッジ日時 2024-09-27 15:36:32
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def n_fact(N):
    c = collections.Counter(prime_factorize(N))
    return c

dic = n_fact(int(input()))
tmp = 0
for k,v in dic.items():
    tmp += v
if tmp > 2:
    print("YES")
else:
    print("NO")
0