|
||||||||||
The Partition of A GraphTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 320 Accepted Submission(s): 119 Problem Description Simple enough, you¡¯ll be given a simple undirected graph with n vertexes and m edges, try to divide this graph fits the following requirements: All edges are divided into several groups; only two edges exist in every group, and this two edges have common vertex. Your task is to figure out if such a partition exists. Input There are multiple test cases, for each test case: The first line contains two integers n (0<n<=1000) and m represent the number of vertexes and edges. The following m lines, each line contains two integers represent two endpoints of an edge. The vertexes are numbered from 1 to n. The input terminated when n=m=0. Output For each test case, output one line, if such a partition exists, print ¡°Yes¡±, otherwise, print ¡°No¡±. Sample Input
Sample Output
Source | ||||||||||
|