bool isMatch(string s, string p) {
int m = s.size();
int n = p.size();
vector<vector<bool>> dp(m+1, vector<bool>(n+1));
dp[0][0] = true;
for(int i=1; i<=m; i++){
dp[i][0] = false;
}
for(int j=1; j<=n; j++){
dp[0][j] = (p[j1] == '*' && dp[0][j1])  false;
}
for(int i=1; i<=m; i++){
for(int j=1; j<=n; j++){
if(p[j1] == '*'){
dp[i][j] = dp[i1][j]  dp[i][j1]  dp[i1][j1];
}else{
dp[i][j] = dp[i1][j1] && (p[j1] == '?'  p[j1] == s[i1]);
}
}
}
return dp[m][n];
Why is my dp cpp solution so slow?


Agree. Refer to Scott Meyers, one should avoid using "vector of bool", which slows the performance. See discussion on stackoverflow (http://stackoverflow.com/questions/6781985/istheuseofstdvectorboolobjectsincacceptableorshouldiuseanal)