asked
Introduction to Python Algorithm Problem Solving (Coding Test Preparation)
1. Setting the environment and solving the Kth divisor
Written on
·
324
0
Answer 2
import sys
# sys.stdin=open("input.txt", "rt")
n, k=map(int, input().split())
cnt=0
for i in range(1, n+1):
if n%i==0:
cnt+=1
if cnt==k:
print(i)
break
else:
print(-1)
이렇게 작성했습니다.
안녕하세요^^
본인 풀코드를 올려주시면 확인해보겠습니다.