class Solution {
public:
/**
* @param obstacleGrid: A list of lists of integers
* @return: An integer
*/
int uniquePathsWithObstacles(vector<vector<int> > &obstacleGrid) {
// write your code here
int m = obstacleGrid.size();
if(m==) return ;
int n = obstacleGrid[].size();
int a[m][n];
int temp=;
for(int i=;i<m;++i){
a[i][]=;
if(obstacleGrid[i][]==){
temp = i;
a[i][]=;
}
if(i>=temp)
a[i][]=;
}
temp = ;
for(int j=;j<n;++j){
a[][j]=;
if(obstacleGrid[][j]==){
temp = j;
a[][j]=;
}
if(j>=temp)
a[][j]=;
}
for(int i =;i < m;++i){
for(int j =;j<n;++j){
a[i][j]=a[i-][j]+a[i][j-];
if(obstacleGrid[i][j]==)
a[i][j]=;
}
}
return a[m-][n-];
}
};

最新文章

  1. secureCRT远程登录工具的颜色配置(转载)
  2. 实现android手机来电拦截系统页面弹出自定义页面特效
  3. eclipse的快捷操作(转)
  4. 如何解决CRUD操作中与业务无关的字段赋值
  5. CentOS7安装Nginx-1.9.9+PHP5.6
  6. Photo Kit 框架
  7. 关于QT安装的一些心得(QT551, VS2013)项目开发配置,以及项目结构分析
  8. Android 学习笔记之Volley(七)实现Json数据加载和解析...
  9. C# XML 文档注释文件格式
  10. Android Studio中Gradle使用详解
  11. 自主创建tcpdump/wireshark pcap文件
  12. wso2esb源码编译总结
  13. HDU 2815 Mod Tree 离散对数 扩张Baby Step Giant Step算法
  14. 解决背景图文字盖住html里面的dom元素
  15. topcoder srm 712 div1
  16. Cannot subclass final class class com.sun.proxy.$Proxy
  17. .Net WEB 程序员需要掌握的技能
  18. JSON转换的原创工具类
  19. remote link Centos6.6 Horrible Slow
  20. asp,对待绑定数据加序号列(DataSet)

热门文章

  1. tomcat多域名配置
  2. PowerDesigner跟表的字段加注释
  3. Making the Elephant Dance: Strategic Enterprise Analysis
  4. NETBSD-DTARCE
  5. spring beans源码解读之--bean definiton解析器
  6. 浅析@Deprecated
  7. 让图片在DIV中垂直居中
  8. Python教程:操作数据库,MySql的安装详解
  9. .net+easyui系列--验证框
  10. IE8下网页中的视频会遮挡住顶层DIV的解决办法