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

怎么回事呀??用dfs时要注意啦!!

Posted by zhuxian at 2009-05-30 18:58:55 on Problem 2446
bool dfs(int d)
{
    int i;
    for(i = 1; i <= count; i++)
       if(!check[i] && g[d][i])
       {
           check[i] = 1;
           if(!link[i] || dfs(link[i]))
           {
                link[i] = d;// xM[u] = v;
                return 1 ;
           }
        }
    return 0 ;
}
里面用这个就超时if(!check[i] && g[d][i])
而把他们交换一下就900ms  if( g[d][i]&&!check[i] )

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