I am stuck in codeforces problem C of round 711, I have successfully implemented solution using memoization, but now I am unable to translate the same into tabulation. Please help me to figure out how to do that.

Problem Link

My Solution

```
int dp[1007][1007;
for(i=1;i<=k;i++){
for(j=0;j<=n;j++){
if(i==1 or j==0){
dp[i][j]=1;
}
else{
dp[i][j]=(dp[i][j-1]+dp[i-1][n-j])℅mod
}
}
cout<<dp[k][n];
```

1 Like

dp[i][j] is the number of particles that bounce in the xth plane with y ages passed from the beginning.

yes, I got that. Thanks

1 Like