摘要: 我第一时间想到的方案是化归而不是规划,毕竟之前的问题类似,所以就有了这个版本:int uniquePathsWithObstacles(vector>& obstacleGrid) { if (obstacleGrid.empty()){ return 0; } co... 阅读全文
posted @ 2015-12-14 16:52 wu_overflow 阅读(251) 评论(0) 推荐(0)
摘要: 但是解答很简单。因为机器人只能向右 / 下 移动,所以要到达目标 A 的可能路线就是到达它正上方的那一块的可能路线数和到达它正右方的那一块的可能路线数之和。所以就简单了:int uniquePaths(int m, int n){ vector> record((m + 1), vector(... 阅读全文
posted @ 2015-12-14 00:59 wu_overflow 阅读(151) 评论(0) 推荐(0)