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:如果双连通分量没写错的话,那就是奇圈那里错了。注意一个点可能在多个双连通分支上,如果你想设标号的话,每次最好给标号做初始化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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator