作业帮 > 英语 > 作业

一道ACM英语题The checking principle is very simple:The computer r

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/21 12:29:05
一道ACM英语题
The checking principle is very simple:The computer regards each fishing net as a simple graph constructed by nodes and edges.In the graph,if any circle whose length (the number of edges) is larger than 3 must has at least one chord,the computer will output "Perfect" indicating that the fishnet has no leaks.Otherwise,"Imperfect" will be displayed and the computer will try to repair the net.
Note:A circle is a closed loop,which starts from one node,passes through other distinct nodes and back to the starting node.A chord is an edge,which connects two different nodes on the circle,but it does not belong to the set of edges on the circle.
寻求翻译就OK
为什么只把题目发上来一部分...
这题是不是叫Fishing Net..弦图的题目..
直接给你题目的简单中文翻译好了...
渔网
显然,渔网的洞越小,捕到的鱼就越多.因此,渔民们在捕鱼回来后,都要检查一下渔网上有没有大的洞,以便在下次出海之前,将这些洞补好.
渔网被简单的看作一个由顶点和边构成的图.如果图中每一个长度大于3的圈,中间至少有一段渔网(连接圈上两个顶点,且不在圈上的边)将其隔开,这个渔网就是"Perfect"的,反之就是"Imperfect".
输入
每组测试数据的第一行为N,M,分别表示顶点的个数和边的个数.下面M行为每行为边的两个顶点.以N=0,M=0结束.
输出
"Perfect"或"Imperfect",每个输出紧随一个空行.
样例
net.in
4 4
1 2
2 3
3 4
4 1
3 3
1 2
2 3
3 1
0 0
net.out
Imperfect
Perfect