Pls point out whats wrong with this code


#1
int n,m;
vector<vector<int>> dp;
void rec(vector<vector<int> > &a, int i, int j, int h, int minh)
{
    if(i<0 || j<0 || i>=n || j>=m)return;
    h+=a[i][j];
    minh=min(minh,h);
    if(dp[i][j]=minh)return;
    dp[i][j]=minh;
    rec(a,i+1,j,h,minh);
    rec(a,i,j+1,h,minh);
}
int Solution::calculateMinimumHP(vector<vector<int> > &a){
    n=a.size();m=a[0].size();
    dp.clear();
    dp.resize(n,vector<int>(m,INT_MIN));
    rec(a,0,0,0,INT_MAX);
    if(dp[n-1][m-1]>=0)return 1;
    return 1-dp[n-1][m-1];
}