题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
from functools import cache @cache def f(m,n): if m<0: return 0 if m==1 or n==1 or m==0: # m==0 剪枝,cache提速 return 1 return f(m,n-1)+f(m-n,n) while True: try: m,n=map(int,input().split()) print(f(m,n)) except: break