题解 | #走方格的方案数#
走方格的方案数
https://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
def f(x, y): if x < 0 or y < 0: # 不存在不需迭代 return 0 if x == 0 or y == 0: # 只有唯一方案 return 1 else: # return f(x - 1, y) + f(x, y - 1) if __name__ == '__main__': m, n = map(int, input().split()) print(f(m,n))