我知道明天就是cspj第二轮了,应该没有大佬还在逛gai了吧[哭]。求帮助QAQ
#include<bits/stdc++.h>
using namespace std;
int point[22][22];
int n,m,horse_x,horse_y;
int main(){
cin>>n>>m>>horse_x>>horse_y;
point[horse_x][horse_y]=-1;
if(horse_x>0&&horse_y>1){
point[horse_x-1][horse_y-2]=-1;
point[horse_x-1][horse_y+2]=-1;
point[horse_x+1][horse_y-2]=-1;
point[horse_x+1][horse_y+2]=-1;
}
if(horse_x>0&&horse_y>1){
point[horse_x-2][horse_y-1]=-1;
point[horse_x-2][horse_y+1]=-1;
point[horse_x+2][horse_y-1]=-1;
point[horse_x+2][horse_y+1]=-1;
}
if(point[0][0]==-1||point[n][m]==-1){
cout<<0<<endl;
return 0;
}
for(int x=0;x<=n;x++){
for(int y=0;y<=m;y++){
if(point[x][y]==-1||(x==0&&y==0)){
point[x][y]++;
continue;
}
if(x>0)
point[x][y]+=point[x-1][y];
if(y>0)
point[x][y]+=point[x][y-1];
}
}
cout<<point[n][m]<<endl;
return 0;
}