#include <vector> class Solution { public: //dp[i][j]:从[0,0]走到[i,j]一共有多少种路径 //递推公式:dp[i][j]=dp[i-1][j] + dp[i][j-1] (i和j都要大于0) //初始化:dp[i][0]=1,dp[0][j]=1 //遍历顺序,正向双层遍历 int uniquePaths(int m, int n) { vector<vector<int> >dp(m,vector<int>(n,1));//初始...