过河卒,为啥没AC
#include <bits/stdc++.h>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int x,y,a,b;//x,y地图大小,a,b马的位置
const int fx[8] = {-2,-1,1,2,2,1,-1,-2};
const int fy[8] = {1,2,2,1,-1,-2,-2,-1};
long long f[40][40];
bool s[40][40];
int main()
{
cin >> x >> y >> a >> b;
x += 2; y += 2; a += 2; b += 2;
f[2][2] = 1;
s[a][b] = 1;
for(int i = 0; i < 8; i++)
s[a + fx[i]][b + fy[i]] = 1;
for(int i = 2; i <= x; i++)
{
for(int j = 2; j <= y; j++)
{
if(s[j][j]) continue;
f[i][j] = max(f[i][j],f[i - 1][j] + f[i][j - 1]);
}
}
cout << f[x][y];
return 0;
}