We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
그리디에서 1이 될때까지 문제 질문입니다. 아래 코드는 제가 작성한 코드입니다. 혹시 책의 예제와는 조금 다른데 예시입력시 같은 출력이 됩니다. 아래 코드도 정답이 될까요??
n, m = map(int, input().split()) cnt = 0 while True: if n == 1: break if n % m == 0: n /= m cnt += 1 elif n % m != 0: n -= 1 cnt += 1 print(cnt)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
그리디에서 1이 될때까지 문제 질문입니다.
아래 코드는 제가 작성한 코드입니다. 혹시 책의 예제와는 조금 다른데 예시입력시 같은 출력이 됩니다.
아래 코드도 정답이 될까요??
The text was updated successfully, but these errors were encountered: