当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5458:Stability

题目描述
Given an undirected connected graph $G$ with $n$ nodes and $m$ edges, with possibly repeated edges and/or loops. The stability of connectedness between node $u$ and node $v$ is defined by the number of edges in this graph which determines the connectedness between them (once we delete this edge, node $u$ and $v$ would be disconnected).

You need to maintain the graph $G$, support the deletions of edges (though we guarantee the graph would always be connected), and answer the query of stability for two given nodes.
输入解释
There are multiple test cases(no more than $3$ cases), and the first line contains an integer $t$, meaning the totally number of test cases.

For each test case, the first line contains three integers $n$, $m$ and $q$, where $1 \le n \le 3 \times 10^4, 1 \le m \le 10^5$ and $1 \le q \le 10^5$. The nodes in graph $G$ are labelled from $1$ to $n$.

Each of the following $m$ lines contains two integers $u$ and $v$ describing an undirected edge between node $u$ and node $v$.

Following $q$ lines - each line describes an operation or a query in the formats:
$\cdot$ $1~a~b$: delete one edge between $a$ and $b$. We guarantee the existence of such edge.
$\cdot$ $2~a~b$: query the stability between $a$ and $b$.
输出解释
For each test case, you should print first the identifier of the test case.

Then for each query, print one line containing the stability between corresponding pair of nodes.
输入样例
1
10 12 14
1 2
1 3
2 4
2 5
3 6
4 7
4 8
5 8
6 10
7 9
8 9
8 10
2 7 9
2 7 10
2 10 6
2 10 5
1 10 6
2 10 1
2 10 6
2 3 10
1 8 5
2 5 10
2 4 5
1 7 9
2 7 9
2 10 5
输出样例
Case #1:
0
0
0
0
2
4
3
3
2
3
4
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5458

最后修改于 2020-10-25T23:22:51+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/2000MS(Java/Others) 65535/102400K(Java/Others)