Submit solution

Points: 15 (partial)
Time limit: 0.5s
Memory limit: 64M

Problem type

A bunch of people on Facebook would like to find out the largest clique among them.
(Maybe this will be the next facebook application?)

A clique is defined as a group of people where everyone is friends with everyone else.
Given a list of friends (friendship works both ways), your job is to output the size of this clique.
For the sake of privacy (and your convenience), we have replaced the names of the people with numbers.

Input Specification

Number of people, 1 \le N \le 32.
Number of friendships, 1 \le M \le \frac{N \times (N-1)}{2}.
M lines, each with 2 numbers 1 \le a, b \le N meaning that a and b are friends.
There will be no duplicate edges.

NOTE: 50\% of test cases will have N \le 24.

Output Specification

The size of the maximum clique.

Sample Input

6 7 
2 3
2 4
2 5
3 4
3 5
4 5
5 6

Sample Output

4

Friends 2,3,4,5 form the largest clique.


Comments

There are no comments at the moment.