Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define mp make_pair
- #define pb push_back
- const int N = 33;
- const int INF = (int)1e18;
- int dp[N][N];
- signed main()
- {
- ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- int n,m;
- cin >> n >> m;
- dp[1][1] = 1;
- for(int i=1;i<=n;i++)
- {
- for(int j=1;j<=m;j++)
- {
- dp[i][j] += dp[i-1][j] + dp[i][j-1];
- }
- }
- cout << dp[n][m];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement