题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
def f(m,n): if n < 0 or m < 0: return False elif m == 1 or n == 1: return 1 else : return f(m,n-1) + f(m-n,n) m,n = list(map(int,input().split())) print(f(m,n))
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
def f(m,n): if n < 0 or m < 0: return False elif m == 1 or n == 1: return 1 else : return f(m,n-1) + f(m-n,n) m,n = list(map(int,input().split())) print(f(m,n))
相关推荐