結果

問題 No.36 素数が嫌い!
ユーザー syunsuke
提出日時 2019-07-27 00:19:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 93,436 KB
最終ジャッジ日時 2024-07-02 10:12:23
合計ジャッジ時間 11,633 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 8 WA * 4 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
import math
X=math.ceil(pow(N,0.5))
L=[1 for i in range(X+1)]
if N==2:
    print("NO")
    exit()
for i in range(2,X+1):
    if L[i]==1:
        if N%i==0:
            print("YES")
            exit()
        for j in range(i*2,X,i):
            #print(i,j)
            L[j]=0
print("NO")
0