#P10778. BZOJ3569 DZY Loves Chinese II
BZOJ3569 DZY Loves Chinese II
Problem Description
Given an undirected graph , there are queries. Each query gives an edge set. Determine whether the graph is connected after deleting this edge set. It is guaranteed that the size of the edge set does not exceed . The queries are forced online.
Input Format
The first line contains two positive integers , representing the number of vertices and edges of the graph.
The next lines each contain two positive integers , representing the -th edge.
Then a line contains , the number of queries.
The next lines: each line starts with an integer , followed by positive integers , representing an edge set of size , where is the index of an edge.
To force online processing, each must be XORed with the number of previous answers that were connected.
Output Format
For each query output: Connected if the graph is connected, otherwise output Disconnected (without quotes).
5 10
2 1
3 2
4 2
5 1
5 3
4 1
4 3
5 2
3 1
5 4
5
1 1
3 7 0 3
4 0 7 4 6
2 2 7
4 5 0 2 13
Connected
Connected
Connected
Connected
Disconnected
Hint
Constraints: , , , . It is guaranteed that the graph has no multiple edges or self-loops.
Translated by ChatGPT 5