这题网上都是用DFS做的,我也不知道怎么用BFS做的。。。有个注意点,就是一步也走不动的时候,输出1Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can Read More
posted @ 2013-06-11 22:30
瓶哥
Views(180)
Comments(0)
Diggs(0)
花3小时打上的注释,分享给大家。。 1 #include 2 #include 3 const int MAXR = 20; 4 const int MAXC = 310; 5 const int MAXN = MAXR * MAXC + MAXC; 6 const int INF = MAXR * 10; 7 8 int n, m; 9 int L[MAXN], R[MAXN], U[MAXN], D[MAXN]; 10 int C[MAXN], O[MAXN], S[MAXN], H[MAXR]; 11 int nodeNumber; 12 13 void ini... Read More
posted @ 2013-06-11 18:14
瓶哥
Views(299)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号