C++
\color{gold}{— > 蓝桥杯辅导课题解}
思路:
DP
\color{blue}{图解分析:}
#include <bits/stdc++.h>
using namespace std;
int f[40][40];
int main() {
int n, m; cin >> n >> m;
f[1][1] = 1;
for (int i = 1; i <= n; i ++)
for (int j = 1; j <= m; j ++) {
if (i == 1 && j == 1) continue;
if (i % 2 || j % 2)
f[i][j] = f[i - 1][j] + f[i][j - 1];
}
cout << f[n][m];
return 0;
}