提交时间:2024-08-20 22:29:00
运行 ID: 173634
#include<bits/stdc++.h> using namespace std; const int N = 101; long long dp[N][N]; long long n, m; int main(){ cin >> m >> n; for(int i = 1; i <= m; i++) dp[i][1] = 1; for(int j = 1; j <= n; j++) dp[1][j] = 1; for(int i = 2; i <= m; i++) { for(int j = 2; j <= n; j++) { dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; } } cout << dp[m][n] << endl; return 0; }