POJ 1861 Network

Source: Internet
Author: User

It is also a minimal spanning tree problem.

Special Judge. The answer is not unique. So the sample looks wrong...


It is also a sad G ++ AC. Submit C ++ and then WA...

We have to go over the road and look at it.


# Include
 
  
# Include
  
   
# Include
   
    
# Include
    
     
# Include
     # Include
      
        # Include
       
         # Include
        
          # Include
         
           # Include
          
            # Define INF 0x7fffffff # define eps 1e-6using namespace std; int n, m; struct lx {int u, v, len; bool vis;} l [500*1001]; int fa [1001]; bool cmp (lx a, lx B) {return. len
           
            

Changed the sorting method.

Then G ++ still AC.

C ++ becomes RE.


#include
             
              #include
              
               #include
               
                #include#include
                
                 #include
                 #include
                  
                   #include
                   
                    #include
                    
                     #include
                     
                      #include
                      
                       #define INF 0x7fffffff#define eps 1e-6using namespace std;int n,m;struct lx{ int u,v,len;} l[500*1001];int fa[1001];bool cmp(const lx &a,const lx &b){ return a.len
                       
                        q; for(int i=0;i
                        
                         

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.