반응형
https://www.acmicpc.net/problem/1978
import math
def isPrime(num):
if num == 1:
return False
n = int(math.sqrt(num))
for i in range(2,n+1):
if num%i==0:
return False
return True
N=int(input())
x=list(map(int,input().split()))
cnt=0
for i in x:
if isPrime(i):
cnt+=1
print(cnt)
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 4948 (0) | 2020.09.02 |
---|---|
baekjoon - python - 2581 (0) | 2020.08.29 |
baekjoon - python - 10039 (0) | 2020.08.29 |
baekjoon - python - 1929 (0) | 2020.08.28 |
baekjoon - python - 1065 (0) | 2020.08.28 |
댓글