인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

ugkk3659300's profile image
ugkk3659300

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

1. Setting the environment and solving the Kth divisor

파이썬 채점 질문 드려요

Written on

·

324

0

똑같이 진행했는데 채점 결과 exit_code_1 로 해서 점수 0이 나왔습니다. 해결 방법이 어캐 되나요?
python코테 준비 같이 해요!

Answer 2

0

ugkk3659300님의 프로필 이미지
ugkk3659300
Questioner

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)

 

이렇게 작성했습니다.

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

본인 풀코드를 올려주시면 확인해보겠습니다.

ugkk3659300's profile image
ugkk3659300

asked

Ask a question