Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我嘞个去,一直判RE ,结果把getchar() , 改成gets(maze[0]) (maze是二维数组名) ,就AC了int main () { // freopen ("a.txt" , "r" , stdin) ; int T ; scanf ("%d" , &T) ; while (T--) { scanf ("%d%d" , &col , &row) ; gets(maze[0]) ;//原来getchar() 一直RE int tol = 1 ; memset (l , -1 , sizeof(l)) ; for (int i = 0 ; i < row ; i++) { gets (maze[i]) ; for (int j = 0 ; j < col ; j++) { if (maze[i][j] == 'A' || maze[i][j] == 'S') { l[i][j] = tol++ ; } } } for (int i = 0 ; i < row ; i++) { for (int j = 0 ; j < col ; j++) { if (l[i][j] != -1) { bfs (i , j); } } } cnt = tol ; prim () ; } return 0 ; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator