Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我嘞个去,一直判RE ,结果把getchar() , 改成gets(maze[0]) (maze是二维数组名) ,就AC了

Posted by windthenrain at 2015-03-04 18:24:41 on Problem 3026
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator