목록백준 1978 (1)
호기심 많은 분석가

1978번: 소수 찾기 첫 줄에 수의 개수 N이 주어진다. N은 100이하이다. 다음으로 N개의 수가 주어지는데 수는 1,000 이하의 자연수이다. www.acmicpc.net import sys def is_prime(x) : import math if x < 2 : return False for i in range(2, int(math.sqrt(x))+1): if x%i == 0 : return False return True n = int(sys.stdin.readline().strip()) arr = list(map(int, sys.stdin.readline().split())) result = 0 for i in arr : if is_prime(i) : result +=1 print(result..
Coding/Coding Test & Algorithm
2021. 6. 2. 22:24