here is my code , it is giving segmentation fault pls do tell the error .
pls do tell whether my logic is correct or not ???
my logic is i have counted all the componenets in this graph .
if cost of temple is less than cost of road , so my ans would be no. of vertex * cost of temple
other wise
my ans would no. of components * cost of temple + element in each component * cost of road