def count_ways(m, n): dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)] # 初始化边界条件 for i in range(n + 1): dp[0][i] = 1 # 没有苹果,分法只有1种 for i in range(1, m + 1): dp[i][1] = 1 # 只有一个盘子,分法只有1种 # 填充dp表 for i in range(1, m + 1): for j in range(2,...