Error in checker


#1

test cass A:45 B:26 function out : 770798009 = expected

but failing on submission
#define ll long long
vector<vector > dp(1001,vector(1001,0));

ll p=1000000007;
int Solution::solve(int A, int B) {

for(int i=0;i<=9;i++)
dp[1][i]=1;

//cout<<A<<" "<<B<<endl;

for(int i=2;i<=A;i++)
{
    for(int j=1;j<=B;j++)
    {   
        for(int k=0;k<=9;k++)
            {if(k<=j)
                if(i-1!=1)
                dp[i][j]=(dp[i][j] + dp[i-1][j-k])%p;
                else if(j-k!=0)
                dp[i][j]=(dp[i][j] + dp[i-1][j-k])%p;
            }
           // cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
    }
    //cout<<endl<<endl;
}
return dp[A][B];

}