提交时间:2023-10-05 23:34:42
运行 ID: 105288
#include<bits/stdc++.h> #define int long long using namespace std; int dp[105][105],o[9][3] = {{-1,-2},{1,-2},{-1,2},{1,2},{-2,-1},{-2,1},{2,-1},{2,1}}; bool f[105][105]; signed main(){ int n,m,x,y; cin>>n>>m>>x>>y; n += 2; m += 2; x += 2; y += 2; dp[2][1] = 1; f[x][y] = true; for (int i = 0;i < 8;i++){ f[x + o[i][0]][y + o[i][1]] = true; } for (int i = 2;i <= n;i++){ for (int j = 2;j <= m;j++){ if (f[i][j]){ continue; } dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; } } cout<<dp[n][m]<<endl; return 0; }