結果

問題 No.36 素数が嫌い!
ユーザー yuppe19 😺
提出日時 2015-09-25 15:20:00
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,075 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 7,200 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 00:30:41
合計ジャッジ時間 5,721 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
def factorize(n):
    from collections import defaultdict
    res = defaultdict(int)
    x = n
    d = 2
    while d * d <= n:
        while n % d == 0:
            res[d] += 1
            n /= d
        d += 1
    if n > 1:
        res[n] += 1
    return {k: v for k, v in res.items() if k!=x}

n = int(raw_input())
factored = factorize(n)
arr = map(sum, zip(*factored.items()))[1:]
cnt = arr.pop() if arr else 0
print 'YES' if cnt >= 3 else 'NO'
0