Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space are marked as 1 and 0 respectively in the grid. For example, There is one obstacle in the midd…
#include<cstdio> #include<vector> #include<cstring> #include<iostream> using namespace std; ; vector<int>a[MAXN]; int n,m,v[MAXN],vis[MAXN],dp[MAXN][MAXN]; void dfs(int root) { dp[root][] = v[root]; vis[root] = ; int i, len =…