https://www.acmicpc.net/problem/2501
2501번: 약수 구하기
첫째 줄에 N과 K가 빈칸을 사이에 두고 주어진다. N은 1 이상 10,000 이하이다. K는 1 이상 N 이하이다.
www.acmicpc.net
# 2501 - Python 3
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
arr = []
for i in range(1, n+1):
if n % i == 0:
arr.append(i)
if len(arr) < m:
print(0)
else:
print(arr[m-1])'코딩' 카테고리의 다른 글
| [Python] 백준 #2581. 소수 (0) | 2023.03.11 |
|---|---|
| [Python] 백준 #9506. 약수들의 합 (0) | 2023.03.10 |
| [Python] 백준 #5086. 배수와 약수 (0) | 2023.03.10 |
| [Python] 백준 #27866. 문자와 문자열 (0) | 2023.03.10 |
| [Python] 백준 #7568. 덩치 (0) | 2023.03.10 |