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

建议使用的浏览器:

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

2975:Find a Minor

题目描述
In a graph G , contraction of an edge e with endpoints u , v is the replacement of u and v with a single vertex such that edges incident to the new vertex are the edges other than e that were incident with u or v . The resulting graph has one less edge than G . A graph H is a minor of a graph G if a copy of H can be obtained from G via repeated edge deletion, edge contraction and isolated node deletion.

Minors play an important role in graph theory. For example, every non-planar graph contains either the graph K3, 3 (i.e., the complete bipartite graph on two sets of three vertices) or the complete graph K5 as a graph minor.

Write a program to find a graph minor Kn, m or Kn in an undirected connected simple graph.

输入解释
The input consists of several test cases. The first line of each case contains an integers V (3<=V<=12) , the number of vertices in the graph, followed by a string in format ``Kn " or ``Kn ,m " (1<=n, m<=V) , the graph minor you're finding. The following V lines contain the adjacency matrix of the graph (1 means directly connected, 0 means not directly connected).

The diagonal elements of the matrix will always be 0, and the element in row i column j is always equal to the element in row j column i . The last test case is followed by a single zero, which should not be processed.

输出解释
For each test case, print the case number and the string ``Found" or ``Not found".

输入样例
5 K2,2 
0 1 1 1 1
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
4 K3 
0 1 0 1 
1 0 1 0 
0 1 0 1 
1 0 1 0 
4 K2,2 
0 1 0 1 
1 0 1 1 
0 1 0 1 
1 1 1 0 
5 K2,2 
0 1 0 0 1
1 0 0 0 1
0 0 0 1 1
0 0 1 0 1
1 1 1 1 0
5 K4 
0 1 0 1 1
1 0 1 1 0
0 1 0 1 1
1 1 1 0 1
1 0 1 1 0
0
输出样例
Case 1: Not found 
Case 2: Found 
Case 3: Found 
Case 4: Not found 
Case 5: Found
来自杭电HDUOJ的附加信息
Recommend gaojie

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

源链接: HDU-2975

最后修改于 2020-10-25T22:58:49+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 32768/32768K(Java/Others)