HBC51463Hotpot,思维Graph Games题解

一天到晚红烧的鱼 算法基础篇 32 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
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.

HBC51463Hotpot,思维Graph Games题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC51463Hotpot 思维Graph Games题解