是我写的搜索有问题吗
#include <iostream>
using namespace std;
int n, m, a[19][19], total;
int xx[5] = {0, 1, 2, 2, 1};
int yy[5] = {0, -2, -1, 1, 2};
void search(int x, int y){
for(int i = 1; i <= 4; i++){
int nx = x + xx[i];
int ny = y + yy[i];
if(nx <= m && ny <= n && ny >= 0){
if(nx == m && ny == n){
total++;
} else {
search(nx, ny);
}
}
}
}
int main(){
cin >> n >> m;
n++; m++;
search(1, 1);
cout << total << endl;
return 0;
}