It is a DFS problem. Simply find the no of components in the graph.
you are gettin WA…because if n==0 then ans=0 not 1.
how can i access map as a vector means how can i use map as vector there?how to access?
why we are getting wa,please help us
It is a DFS problem. Simply find the no of components in the graph.
you are gettin WA…because if n==0 then ans=0 not 1.
how can i access map as a vector means how can i use map as vector there?how to access?
why we are getting wa,please help us