We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
그리디에서 1이 될때까지 문제 질문입니다.아래 코드는 제가 작성한 코드입니다. 혹시 책의 예제와는 조금 다른데 예시입력시 같은 출력이 됩니다.아래 코드도 정답이 될까요??
n,m=map(int,input().split())cnt=0whileTrue:ifn==1:breakifn%m==0:n/=mcnt+=1elifn%m!=0:n-=1cnt+=1print(cnt)