A Graph Problem

Правка en1, от Not-Afraid, 2019-12-20 12:35:26

Given a simple undirected and connected graph with $$$N$$$ nodes and $$$M$$$ edges. Also two different nodes are given $$$a$$$ and $$$b$$$. We have to answer $$$q$$$ queries. Each query contains an integer $$$v$$$(i.e. a node) from $$$1$$$ to $$$N$$$, we need to answer if we remove node $$$v$$$ and all of it's adjacent edges from the given graph, do nodes $$$a$$$ and $$$b$$$ lies in the same connected component or not? All queries are independent.

Constraints
My partial solution

PS: This problem is not from any contest.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Not-Afraid 2019-12-20 12:36:27 65 Tiny change: 'ed. Thanks' -> 'ed. Thanks.'
en1 Английский Not-Afraid 2019-12-20 12:35:26 733 Initial revision (published)