結果

問題 No.36 素数が嫌い!
コンテスト
ユーザー aka_satana_ha
提出日時 2017-12-22 12:08:05
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 490 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 120 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 86,656 KB
最終ジャッジ日時 2026-10-04 21:08:16
合計ジャッジ時間 77,202 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 1 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

N=int(input())
prime_max=int(math.sqrt(N))+1
is_prime=[True for i in range(prime_max)]

#ふるい
for i in range(2,prime_max):
    if is_prime[i]==True:
        tmp=i+i
        while(tmp<prime_max):
            is_prime[tmp]=False
            tmp+=i
# print(is_prime)

count=0
j=2
while(j<prime_max and count<2):
    if is_prime[j]==True:
        if N%j==0:
            count+=1
            N=int(N/j)
            continue
    j+=1

out='YES' if count>=2 else 'NO'
print(out)
0