提交时间:2023-10-12 13:19:22

运行 ID: 106490

#include<iostream> using namespace std; unsigned long long n,m,x,y; unsigned long long a[25][25]; int p(int a,int b){ if(((x+1==a)||(x-1==a))&&((y+2==b)||(y-2)==b)||((x+2==a)||(x-2==a))&&((y+1==b)||(y-1)==b)||(x==a&&y==b)){ return 1; }else{ return 0; } } int main(){ cin>>n>>m>>x>>y; x++; y++; a[1][1]=1; for(int i=1;i<=n+1;i++){ for(int o=1;o<=m+1;o++){ if(p(i,o)==1){ a[i][o]=0; } a[1][1]=1; if(p(i,o)==0){ a[i][o]=a[i-1][o]+a[i][o-1]; } } } cout<<a[n+1][m+1]; return 0; }