提交时间:2023-06-20 08:22:25
运行 ID: 20774
#include<bits/stdc++.h> using namespace std; bool vis[30][30]; long long dp[30][30]; int n,m,x,y; int main(){ dp[1][1]=1; cin>>n>>m>>x>>y; n++; m++; x++; y++; vis[x][y]=1; vis[x-2][y-1]=1; vis[x-2][y+1]=1; vis[x+2][y-1]=1; vis[x+2][y+1]=1; vis[x-1][y+2]=1; vis[x-1][y-2]=1; vis[x+1][y+2]=1; vis[x+1][y-2]=1; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(i==1&&j==1) continue; if(vis[i][j]==0) dp[i][j]=dp[i-1][j]+dp[i][j-1]; } } cout<<dp[n][m]; return 0; }