1.longlong
2.边界有一点不可达,则后面均不可达
#include <bits/stdc++.h>using namespace std;int main(){long long aa[25][25], bb[25][25];long long a, b, x, y;cin >> a >> b >> x >> y;if (a < x || b < y)return 0;for (int i = 0; i < 25; i++)for (int l = 0; l < 25; l++){aa[i][l] = 0;bb[i][l] = 0;}aa[x][y] = 1;aa[x + 1][y + 2] = 1;aa[x + 1][y - 2] = 1;aa[x - 1][y + 2] = 1;aa[x - 1][y - 2] = 1;aa[x + 2][y - 1] = 1;aa[x + 2][y + 1] = 1;aa[x - 2][y - 1] = 1;aa[x - 2][y + 1] = 1;for (int i = 0; i < 25; i++){if (aa[i][0] == 1){for (int l = i; l < 25; l++){bb[l][0] = 0;}break;}elsebb[i][0] = 1;}for (int i = 0; i < 25; i++){if (aa[0][i] == 1){for (int l = i; l < 25; l++){bb[0][l] = 0;}break;}elsebb[0][i] = 1;}for (int i = 1; i <= a; i++)for (int l = 1; l <= b; l++){if (aa[i][l] == 0)bb[i][l] = bb[i - 1][l] + bb[i][l - 1];}cout << bb[a][b];}