結果

問題 No.36 素数が嫌い!
ユーザー syunsukesyunsuke
提出日時 2019-07-27 00:19:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 85,364 KB
最終ジャッジ日時 2023-09-15 05:13:26
合計ジャッジ時間 29,645 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 204 ms
44,668 KB
testcase_01 AC 1,508 ms
67,644 KB
testcase_02 AC 15 ms
8,540 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 30 ms
8,828 KB
testcase_08 AC 17 ms
8,656 KB
testcase_09 AC 17 ms
8,588 KB
testcase_10 AC 18 ms
8,640 KB
testcase_11 AC 1,673 ms
33,068 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 2,140 ms
55,520 KB
testcase_15 AC 15 ms
8,596 KB
testcase_16 AC 16 ms
8,304 KB
testcase_17 AC 16 ms
8,180 KB
testcase_18 AC 16 ms
8,480 KB
testcase_19 AC 171 ms
38,080 KB
testcase_20 AC 810 ms
85,364 KB
testcase_21 AC 317 ms
67,200 KB
testcase_22 AC 1,401 ms
68,548 KB
testcase_23 AC 703 ms
44,408 KB
testcase_24 AC 743 ms
49,672 KB
testcase_25 AC 436 ms
47,716 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

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