結果

問題 No.36 素数が嫌い!
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-09-25 15:20:16
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 240 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 77,716 KB
実行使用メモリ 79,052 KB
最終ジャッジ日時 2023-09-09 07:22:41
合計ジャッジ時間 4,744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
78,788 KB
testcase_01 AC 88 ms
78,708 KB
testcase_02 AC 79 ms
78,228 KB
testcase_03 AC 80 ms
78,480 KB
testcase_04 AC 81 ms
78,028 KB
testcase_05 AC 84 ms
78,700 KB
testcase_06 AC 83 ms
78,684 KB
testcase_07 AC 83 ms
78,704 KB
testcase_08 AC 81 ms
78,488 KB
testcase_09 AC 82 ms
77,964 KB
testcase_10 AC 82 ms
78,728 KB
testcase_11 AC 134 ms
78,644 KB
testcase_12 AC 239 ms
78,640 KB
testcase_13 AC 240 ms
78,800 KB
testcase_14 AC 84 ms
78,624 KB
testcase_15 AC 80 ms
78,240 KB
testcase_16 AC 82 ms
78,280 KB
testcase_17 AC 81 ms
77,916 KB
testcase_18 AC 81 ms
78,292 KB
testcase_19 AC 90 ms
78,788 KB
testcase_20 AC 89 ms
78,708 KB
testcase_21 AC 103 ms
78,704 KB
testcase_22 AC 82 ms
78,800 KB
testcase_23 AC 81 ms
78,768 KB
testcase_24 AC 103 ms
78,740 KB
testcase_25 AC 107 ms
79,008 KB
testcase_26 AC 136 ms
78,884 KB
testcase_27 AC 83 ms
78,864 KB
testcase_28 AC 135 ms
79,052 KB
testcase_29 AC 82 ms
78,600 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