Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n = 23;
  7.     int m = 15;
  8.     int dp[n+2][m+2];
  9.     for(int i=0;i<n;i++){
  10.         for(int j=0;j<m;j++){
  11.             dp[i][j]=0;
  12.         }
  13.     }
  14.     dp[0][0]=1;
  15.     for(int i =0;i<n;i++){
  16.             for(int j=0;j<m;j++){
  17.                 dp[i+2][j+1] +=dp[i][j];
  18.                 dp[i+1][j+2] += dp[i][j];
  19.             }
  20.     }
  21.     cout<<dp[n-1][m-1];
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement