I need some help...

Revision en3, by Firestone, 2021-07-04 19:47:35

Given a graph with n vertices (2 <= n <= 200). Find the largest set of vertices that each two vertices are connected.

Time: 1s, memory: 256GB

Input: First line contains two numbers n and k — the vertices and the edges.

Next k lines contains the k edges.

Output: The first line contain one number — The size of the set

The second line represents the vertices in the set. If there are more than one set that have the maximum size, print the set that is lexicographically smallest.

Example:

Input:

5 3

1 3

1 4

2 5

Output:

2

1 4

How can I solve this problem? Can you help me with this? Thank you!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Firestone 2021-07-05 06:11:48 2 Tiny change: 'emory: 256GB\n\nInput' -> 'emory: 256MB\n\nInput'
en3 English Firestone 2021-07-04 19:47:35 1 Tiny change: ' set of vetices that' -> ' set of vertices that'
en2 English Firestone 2021-07-04 19:45:04 6 Tiny change: ':\n\n5 3\n1 3\n1 4\n2 5\n\nO' -> ':\n\n5 3\n\n1 3\n\n1 4\n\n2 5\n\nO'
en1 English Firestone 2021-07-04 19:44:35 661 Initial revision (published)