题解 | 放苹果
def f(m,n):
if m<0 or n<0:
return 0
if m==1 or n==1:
return 1
return f(m,n-1)+f(m-n,n)
m,n=map(int,input().split())
print(f(m,n))
def f(m,n):
if m<0 or n<0:
return 0
if m==1 or n==1:
return 1
return f(m,n-1)+f(m-n,n)
m,n=map(int,input().split())
print(f(m,n))
相关推荐