Super Mancunian

  • + 0 comments

    Hey guys I'm getting only 24.38 points. Here is a psuedo code of mine.

    lli Kruskal()
    {
    	lli Minimum_Cost=0;
    	lli i;
    	
    	rep(i,0,V.sz())
    	{
    		lli x=V[i].S.F;
    		lli y=V[i].S.S;
    		lli w=V[i].F;
    		
    		if(root(x)!=root(y))
    		{
    		    cnt++;
    		    
    		    if(cnt==N-1)
    		    {
    		        cnt--;
    		        Count++;
    		    }
    		    else
                {
                    Union(x,y);
    			
    		     	Minimum_Cost+=w;
                }
            }
    	}
    	
     return Minimum_Cost;	
    }
    

    And I print Minimum_Cost and Count.