题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
python3递归求解
def func(m,n): if m == 0 or n ==1 or m == 1: return 1 elif m < n: return func(m, m) else: return func(m, n-1) + func(m - n, n) while True: try: m,n = map(int, input().split()) print(func(m, n)) except: break