#P10075. [GDKOI2024 普及组] 切割
[GDKOI2024 普及组] 切割
Problem Description
Given an undirected connected graph with vertices and edges, it can have multiple edges but has no self-loops.
ymqOAO now has queries. In each query, if edges are deleted from the graph, determine whether the remaining graph is still connected.
Note: The queries are independent of each other. Deleting edges in one query will not affect later queries.
Notes:
- Connected graph: In a graph, any two vertices are connected by a path.
Input Format
The first line contains three integers .
The next lines each contain two positive integers , meaning that the -th edge connects and .
The next line contains an integer , the number of queries.
The next lines describe the queries. In the -th line, the first integer is the number of edges to be cut, followed by integers giving the indices of the edges to be cut. The edge indices are in .
Output Format
For each query, if the graph is not connected, output Bob; otherwise output ymqOAO (without quotes).
4 5
1 2
2 3
3 4
4 1
2 4
3
1 5
2 2 3
2 1 2
ymqOAO
Bob
ymqOAO
Hint
Constraints:
- For of the testdata, .
- For another of the testdata, .
- For another of the testdata, .
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5