In how many ways one can get from the bottom left cell to top right cell of a 9 \times 999 grid, if each move is either two cells up or three cells to the right?
Answers
Answered by
0
Answer:
I don't know man. I am not yet in that grade. I am so sorry, I can't help you.
Answered by
0
Answer:
0
Explanation:
#include <iostream>
using namespace std;
int main() {
int dp[10][1005] = {0,};
for(int i=0;i<1000;i+=3)
dp[0][i]= 1;
for(int i=0;i<10;i+=2)
dp[i][0] = 1;
for(int i=0;i<10;i++){
for(int j=0;j<1000;j++){
int x,y,w,z;
x = i;
y = j - 3;
w = i-2;
z = j;
if(x >= 0 && y >= 0)
dp[i][j] += dp[x][j];
if( w >=0 && z >=0)
dp[i][j] += dp[w][z];
}
}
cout<<dp[8][998]<<endl;
}
Similar questions