提交时间:2024-11-09 22:45:58

运行 ID: 56268

#include<bits/stdc++.h> using namespace std; const int N = 110; long long ans[N][N]; int main() { int m, n; cin >> m >> n; for (int i = 1; i <= m; i++) { for (int j = 1; j <= m; j++) { if(i == 1 || j == 1) ans[i][j] = 1; else if(i != 1 && j != 1) ans[i][j] = ans[i - 1][j] + ans[i][j - 1]; } } cout << ans[m][n]; return 0; }