結果

問題 No.36 素数が嫌い!
ユーザー DialBirdDialBird
提出日時 2017-03-12 17:07:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 474 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 155,424 KB
最終ジャッジ日時 2023-09-12 12:05:41
合計ジャッジ時間 71,417 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,544 ms
104,272 KB
testcase_01 AC 4,141 ms
120,848 KB
testcase_02 AC 117 ms
86,336 KB
testcase_03 AC 119 ms
86,336 KB
testcase_04 AC 119 ms
86,200 KB
testcase_05 AC 131 ms
86,520 KB
testcase_06 AC 132 ms
86,424 KB
testcase_07 AC 130 ms
86,460 KB
testcase_08 AC 122 ms
86,276 KB
testcase_09 AC 127 ms
86,460 KB
testcase_10 AC 129 ms
86,512 KB
testcase_11 AC 1,799 ms
103,656 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 3,330 ms
120,656 KB
testcase_15 AC 118 ms
86,348 KB
testcase_16 AC 118 ms
86,364 KB
testcase_17 AC 119 ms
86,280 KB
testcase_18 AC 121 ms
86,296 KB
testcase_19 AC 2,151 ms
103,700 KB
testcase_20 TLE -
testcase_21 AC 4,088 ms
120,656 KB
testcase_22 AC 4,232 ms
120,660 KB
testcase_23 AC 2,614 ms
120,712 KB
testcase_24 AC 2,820 ms
120,792 KB
testcase_25 AC 2,881 ms
120,788 KB
testcase_26 AC 3,327 ms
120,724 KB
testcase_27 AC 4,887 ms
120,840 KB
testcase_28 AC 3,329 ms
120,692 KB
testcase_29 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt

N = int(input())

prime_checker = [1]*10000001
primes = set([])

for i in range(2, int(sqrt(N)) + 1):
    if prime_checker[i] == 1:
        primes.add(i)
        for j in range(i*2, int(sqrt(N)) + 1, i):
            prime_checker[j] = 0

cnt = 0
for i in primes:
    if N == 1:
        break
    while N % i == 0:
        N //= i
        cnt += 1
        if cnt >= 3: break

if N != 1:
    cnt += 1

if cnt >= 3:
    print("YES")
else:
    print("NO")
0