答案:509
#include <cstdio>
int ans = 0;
bool vis[10][10] = {false};
int X[4] = {1, -1, 0, 0};
int Y[4] = {0, 0, 1, -1};
void dfs(int x, int y){
if(x<=0 || x>=6 || y<=0 || y>=6){
ans++;
return;
}
for(int i=0; i<4; i++){
int tempX = x + X[i];
int tempY = y + Y[i];
if(!vis[tempX][tempY]){
vis[tempX][tempY] = vis[6-tempX][6-tempY] = true;
dfs(tempX,tempY);
vis[tempX][tempY] = vis[6-tempX][6-tempY] = false;
}
}
}
int main(){
vis[3][3] = true;
dfs(3,3);
printf("%d", ans/4);
return 0;
}