You are given an undirected graph with N NNvertices and M MM edges. The edges are numbered from 1 11to M MM. Denote the set S SSas: All the vertices we can reach from vertex x xx by exactlyone edge. You are supposed to deal with Q QQoperations of the following two types: -- reverse the status of edges numbered between l ll to r rr . i.e. Delete the edge if it is in the graph, otherwise add it to the graph. -- ask whether S SS and S SS are exactly the same . Note that all the M MMedges are in the graph at the beginning.
You are given an undirected graph with N N N vertices and M M M edges. The edges are numbered from 1 1 1 to M M M . Denote the set S(x) S(x) S(x) as: All the vertices we can reach from vertex x x x by exactly one edge. You are supposed to deal with Q Q Q operations of the following two types: (1,l,r) (1,l,r) (1,l,r)-- reverse the status of edges numbered between l l l to r r r (1≤l≤r≤M)(1 leq l leq r leq M)(1≤l≤r≤M) . i.e. Delete the edge if it is in the graph, otherwise add it to the graph. (2,u,v) (2,u,v) (2,u,v) -- ask whether S(u) S(u) S(u) and S(v) S(v) S(v) are exactly the same (1≤u≤v≤N)(1 leq u leq v leq N)(1≤u≤v≤N). Note that all the M M M edges are in the graph at the beginning.
