#include #include #include using namespace std; #define max 510 int mo[4][2]={ {-1,0}, {0,1}, {1,0}, {0,-1} }; struct node{ int ge[4]; int vis[4]; int fuhao; }map[max][max]; struct data{ int x,y,g; }d[max][max][4]; int m,n,color,white; void bfs(int x,int y,int r) { queue q; int i,j,k; if(map[x][y].vis[r]) return; data t; t.x=x;t.y=y;t.g=r; q.push(t); map[x][y].vis[r]=1; map[x][y].ge[r]=color; while(!q.empty()) { data p; p=q.front(); q.pop(); i=p.x; j=p.y; k=p.g; if(map[i][j].fuhao=='\\') { if(map[i][j].vis[(5-k)%4]==0) { q.push(d[i][j][(5-k)%4]); map[i][j].vis[(5-k)%4]=1; map[i][j].ge[(5-k)%4]=color; } if(0<=i+mo[k][0]&&i+mo[k][0]