結果

問題 No.36 素数が嫌い!
ユーザー shobonvipshobonvip
提出日時 2020-05-10 20:40:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 804 ms / 5,000 ms
コード長 369 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 8,524 KB
最終ジャッジ日時 2023-09-22 15:13:02
合計ジャッジ時間 11,361 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 383 ms
8,296 KB
testcase_01 AC 474 ms
8,364 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 14 ms
7,908 KB
testcase_05 AC 18 ms
7,804 KB
testcase_06 AC 18 ms
7,872 KB
testcase_07 AC 17 ms
7,908 KB
testcase_08 AC 15 ms
8,344 KB
testcase_09 AC 16 ms
8,328 KB
testcase_10 AC 17 ms
8,376 KB
testcase_11 AC 272 ms
7,764 KB
testcase_12 AC 797 ms
7,844 KB
testcase_13 AC 804 ms
8,000 KB
testcase_14 AC 335 ms
8,476 KB
testcase_15 AC 15 ms
8,376 KB
testcase_16 AC 15 ms
7,952 KB
testcase_17 AC 15 ms
7,800 KB
testcase_18 AC 15 ms
8,376 KB
testcase_19 AC 323 ms
8,524 KB
testcase_20 AC 629 ms
8,328 KB
testcase_21 AC 622 ms
8,336 KB
testcase_22 AC 640 ms
8,376 KB
testcase_23 AC 388 ms
8,328 KB
testcase_24 AC 329 ms
8,332 KB
testcase_25 AC 428 ms
8,404 KB
testcase_26 AC 496 ms
7,832 KB
testcase_27 AC 696 ms
7,852 KB
testcase_28 AC 480 ms
7,860 KB
testcase_29 AC 778 ms
7,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**7)

def primefac(n):
    pf = {}
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            pf[i] = pf.get(i, 0) + 1
            n //= i
    if n > 1: pf[n] = 1
    return pf

n = int(input())
pf = primefac(n)
cnt = 0
for i in pf.items():
    cnt += i[1]
if cnt >= 3:
    print("YES")
    sys.exit()
print("NO")
0