結果

問題 No.36 素数が嫌い!
ユーザー ixmelixmel
提出日時 2017-03-30 20:50:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 10,848 KB
実行使用メモリ 88,712 KB
最終ジャッジ日時 2023-09-21 08:53:12
合計ジャッジ時間 68,285 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,843 ms
86,692 KB
testcase_01 WA -
testcase_02 AC 1,815 ms
86,780 KB
testcase_03 AC 1,801 ms
86,828 KB
testcase_04 AC 1,817 ms
86,696 KB
testcase_05 AC 1,820 ms
86,928 KB
testcase_06 AC 1,817 ms
88,620 KB
testcase_07 AC 1,832 ms
86,716 KB
testcase_08 AC 1,807 ms
86,816 KB
testcase_09 AC 1,807 ms
86,836 KB
testcase_10 AC 1,795 ms
86,872 KB
testcase_11 AC 2,219 ms
86,696 KB
testcase_12 AC 3,149 ms
86,804 KB
testcase_13 AC 3,204 ms
86,940 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1,809 ms
86,772 KB
testcase_17 AC 1,826 ms
88,128 KB
testcase_18 AC 1,825 ms
86,796 KB
testcase_19 AC 1,833 ms
86,692 KB
testcase_20 AC 1,951 ms
86,696 KB
testcase_21 AC 1,773 ms
86,936 KB
testcase_22 AC 1,769 ms
86,780 KB
testcase_23 AC 1,805 ms
86,852 KB
testcase_24 WA -
testcase_25 AC 1,780 ms
88,504 KB
testcase_26 AC 2,685 ms
86,844 KB
testcase_27 AC 3,007 ms
88,204 KB
testcase_28 AC 2,613 ms
86,844 KB
testcase_29 AC 3,150 ms
88,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def sieve(n):
	p=[True for i in range(n+1)]
	p[0]=p[1]=False
	end=int(n**0.5)
	for i in range(2,end+1):
		if p[i]:
			for j in range(i*i,n+1,i):
				p[j]=False
	return p
p=sieve(10**7+10)
out="NO"
n=int(input())
for i in range(2,int(math.sqrt(n))+1):
	if n%i==0 and p[i]==0:
		out="YES"
		break
print(out)
0