SP9576 DYNACON2 - Dynamic Graph Connectivity
Description
A graph initially consists of N (1
Your task is to maintain that graph and answer connectivity queries.
All edges in the problem are **undirected**.
You will receive the following queries, where (1
- **add** A B : add an edge between vertices A and B, where initially there is no path between A and B.
- **rem** A B : remove edge between vertices A and B, where initially there is an edge between A and B.
- **conn** A B : print **YES** if there is a path between A and B and **NO** otherwise, where A and B are different.
Input Format
N/A
Output Format
N/A