POJ1291-并查集/dfs(四)

2014-11-23 21:54:17 · 作者: · 浏览: 39
nbsp;{  
  •                   
  •                 fax = find( x1 );  
  •                 fay = find( y2 );  
  •                 if( fax==fay ){  
  •                     f = false;  
  •                     continue;  
  •                 }  
  •                 fax = find( x2 );  
  •                 fay = find( y1 );  
  •                 if( fax==fay ){  
  •                     f = false;  
  •                     
    continue
    ;  
  •                 }  
  •                   
  •                 union_ab( x1,y1 );  
  •                 union_ab( x2,y2 );  
  •                 addedge( x1,y1 );  
  •                 addedge( x2,y2 );  
  •             }  
  •         }  
  •         if( f==false ) {  
  •             puts("Inconsistent");  
  •             continue;  
  •         }//specail judge  
  •         for