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:如果双连通分量没写错的话,那就是奇圈那里错了。注意一个点可能在多个双连通分支上,如果你想设标号的话,每次最好给标号做初始化

Posted by chhot at 2006-08-19 17:32:55 on Problem 2942
In Reply To:如果双连通分量没写错的话,那就是奇圈那里错了。注意一个点可能在多个双连通分支上,如果你想设标号的话,每次最好给标号做初始化 Posted by:wywcgs at 2006-08-19 17:25:47
求双连通分量,我是对边进行的处理,即如下:
            if(low[v] >= dfn[u])
            {
                for(j=1; j<=n; j++) 
                {
                    comp[j].clear();
                    mark[j] = 0;
                }
                st = u;
                do{
                    x = stack[top].x; y = stack[top].y;
                    comp[x].push_back(y);
                    comp[y].push_back(x);
                    mark[x] = mark[y] = 1;
                    top--;
                }while(!((x == u && y == v) || (x == v && y == u)));
                for(j=1; j<=n; j++) color[j] = -1;
                if(!check_dfs(st,0))/*判奇圈*/
                {
                    for(j=1; j<=n; j++) ans[j] |= mark[j];
                }
            }
是不是这处理的有问题? 可是我感觉没有问题呀!

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