标签:bsp color class == continue log solution code amp
class Solution { public: int uniquePaths(int m, int n) { vector<vector<int>> result(m,vector<int>(n)); result[0][0] = 1; for(int i = 0;i < m;i++){ for(int j = 0;j < n;j++){ if(i == 0 && j == 0) continue; if(i != 0 && j != 0){ result[i][j] = result[i][j-1] + result[i-1][j]; } else if(i == 0) result[i][j] = result[i][j-1]; else result[i][j] = result[i-1][j]; } } return result[m-1][n-1]; } };
标签:bsp color class == continue log solution code amp
原文地址:http://www.cnblogs.com/ymjyqsx/p/7467475.html