第三篇英语翻译
重点单词:
graph: n.图表,曲线图,坐标图。
respective adj. 分别的,各自的。
cope v.对付,处理。
sequence n.顺序,次序;
vertice n.顶点。
lexicographically adv.按字典序地
图论中的,好吧,我还是没太搞懂意思;
Interestring graph and Apples
描述:
Hexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started to work on a still-life ?interesting graph and apples?. An undirected graph is called interesting, if each of its vertices belongs to one cycle only — a funny ring — and does not belong to any other cycles. A funny ring is a cycle that goes through all the vertices just once. Moreover, loops are funny rings too.
Hexadecimal 喜欢画画。她已经画了很多图表,包括非曲直的和曲直的。最近,她开始创作静物《有趣的图形和苹果》。一个曲直的图表被称为有趣图,如果它的每个顶点只属于一个圆环,而不属于任何其他圆环,那它被称作一个有趣的环。有趣的环是一个圆环,它只经过所有顶点一次。此外,环也是有趣的环。
She has already drawn the apples and some of the graph edges. But now it is not clear, how to connect the rest of the vertices to get an interesting graph as a result.
The answer should contain the minimal amount of added edges. And furthermore, the answer should be the lexicographically smallest one.
The set of edges (x1,?y1),?(x2,?y2),?...,?(xn,?yn), where xi?≤?yi, is lexicographically smaller than the set (u1,?v1),?(u2,?v2),?...,?(un,?vn),
where ui?≤?vi, provided that the sequence of integers x1,?y1,?x2,?y2,?...,?xn,?yn is lexicographically smaller than the sequence u1,?v1,?u2,?v2,?...,?un,?vn.
If you do not cope, Hexadecimal will eat you. ...eat you alive.
她已经画好了苹果和一些图形的边缘。但是现在还不清楚如何连接其余的顶点,从而得到一个有趣的图形。答案应该包含最小数量的添加边。而且,答案应该是按照词典序摆列中最小的一个。
边集(x1,?y1),?(x2,?y2),?...,?(xn,?yn),其中xi?≤?yi,在词典编纂上比集合更小(u1,?v1),?(u2,?v2),?...,?(un,?vn),其中ui?≤?vi,
前提是整数序列x1,?y1,?x2,?y2,?...,?xn,?yn在字典上比序列u1小,?v1,?u2,?v2,?...,?un,vn。
如果你不去解决这个问题, Hexadecimal 将会吃掉你,活生生地吃掉你。
输入:
The first line of the input data contains a pair of integers n and m (1?≤?n?≤?50, 0?≤?m?≤?2500) — the amount of vertices and edges respectively. The following lines contain pairs of numbers xi and yi (1?≤?xi, yi?≤?n) — the vertices that are already connected by edges. The initial graph may contain multiple edges and loops.
输入数据的第一行包含一对整数n和m(1?≤?N?≤?50, 0?≤?M?≤?2500)-分别为顶点和边的数量。接下来的行包含数对xi和yi(1?≤?xi,yi≤?n) -已通过边连接的顶点。初始图形可能包含多个边和圆环。
输出:
In the first line output ?YES? or ?NO?: if it is possible or not to construct an interesting graph. If the answer is ?YES?, in the second line output k — the amount of edges that should be added to the initial graph. Finally, output k lines: pairs of vertices xj and yj, between which edges should be drawn. The result may contain multiple edges and loops. k can be equal to zero.
在第一行输出中?是?或?否?:是否可以构建有趣的图形。如果答案为?是?,则在第二行输出k中-应添加到初始图形的边数。最后,输出k条行:一对顶点xj和yj,在它们之间应该绘制边。结果可能包含多个边和圆环。k可以等于零。
样例输入:
3 2
1 2
2 3
样例输出:
YES
1
1 3