题解 | #走方格的方案数#
走方格的方案数
https://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
import sys n = list(map(int,input().split())) dp = [1]*(n[1]+1) for i in range(1,n[0]+1): for j in range(1,n[1]+1): dp[j] += dp[j-1] print(dp[n[1]])
走方格的方案数
https://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
import sys n = list(map(int,input().split())) dp = [1]*(n[1]+1) for i in range(1,n[0]+1): for j in range(1,n[1]+1): dp[j] += dp[j-1] print(dp[n[1]])
相关推荐