|
|
back to boardWho can explain me this problem with DP? (with this formula) F[i][j]=F[i-j-1][j+1]+F[i][j+1]; cout << F[N-1][0]-1<< endl;; Re: Who can explain me this problem with DP? (with this formula) F[i][j] corresponds to staircase using i bricks with height of 1st step>=j. height of 1st step will either be j in which case, it will give f[i-j-1][j+1] or it will be greater than j, in which case it is just f[i][j+1]. |
|
|