結果

問題 No.36 素数が嫌い!
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-09-25 15:20:00
言語 Python2
(2.7.18)
結果
AC  
実行時間 999 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 6,732 KB
実行使用メモリ 6,424 KB
最終ジャッジ日時 2023-09-09 07:22:21
合計ジャッジ時間 5,621 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 241 ms
6,300 KB
testcase_01 AC 30 ms
6,216 KB
testcase_02 AC 12 ms
6,292 KB
testcase_03 AC 12 ms
6,296 KB
testcase_04 AC 12 ms
6,404 KB
testcase_05 AC 14 ms
6,348 KB
testcase_06 AC 15 ms
6,272 KB
testcase_07 AC 15 ms
6,288 KB
testcase_08 AC 12 ms
6,236 KB
testcase_09 AC 11 ms
6,340 KB
testcase_10 AC 12 ms
6,212 KB
testcase_11 AC 335 ms
6,288 KB
testcase_12 AC 999 ms
6,288 KB
testcase_13 AC 996 ms
6,284 KB
testcase_14 AC 16 ms
6,200 KB
testcase_15 AC 12 ms
6,200 KB
testcase_16 AC 12 ms
6,224 KB
testcase_17 AC 12 ms
6,228 KB
testcase_18 AC 12 ms
6,300 KB
testcase_19 AC 52 ms
6,292 KB
testcase_20 AC 43 ms
6,368 KB
testcase_21 AC 142 ms
6,316 KB
testcase_22 AC 27 ms
6,376 KB
testcase_23 AC 18 ms
6,368 KB
testcase_24 AC 154 ms
6,284 KB
testcase_25 AC 182 ms
6,316 KB
testcase_26 AC 358 ms
6,288 KB
testcase_27 AC 30 ms
6,272 KB
testcase_28 AC 350 ms
6,424 KB
testcase_29 AC 20 ms
6,216 KB
権限があれば一括ダウンロードができます

ソースコード

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