https://www.acmicpc.net/problem/1978
1978λ²: μμ μ°ΎκΈ°
첫 μ€μ μμ κ°μ Nμ΄ μ£Όμ΄μ§λ€. Nμ 100μ΄νμ΄λ€. λ€μμΌλ‘ Nκ°μ μκ° μ£Όμ΄μ§λλ° μλ 1,000 μ΄νμ μμ°μμ΄λ€.
www.acmicpc.net
n = int(input())
num = list(map(int,input().split()))
cnt = 0 # μμκ° μλ μμ κ°μ
for i in num:
k = 2
if i == 1:
cnt += 1
while i > k:
if i % k == 0:
cnt += 1
break
k += 1
print(n-cnt)
cnt : μμκ° μλ μμ κ°μ
'π€ > λ°±μ€' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
| λ°±μ€ 11653: μμΈμλΆν΄ (Python) (0) | 2021.08.31 |
|---|---|
| λ°±μ€ 2581: μμ (Python) (0) | 2021.08.31 |
| λ°±μ€ 1011: Fly me to the Alpha Centauri (Python) (0) | 2021.08.31 |
| λ°±μ€ 2839: μ€ν λ°°λ¬ (Python) (0) | 2021.08.30 |
| λ°±μ€ 2884: λΆλ νμ₯μ΄ λ ν μΌ (Python) (0) | 2021.08.30 |