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
- int n , m;
- int dp[35][35];
- signed main()
- {
- cin >> n >> m;
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= m; j++){
- if((i == 1) && (j == 1)){
- dp[i][j] = 1;
- continue;
- }
- dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
- }
- }
- cout << dp[n][m] << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement