#P8653. [蓝桥杯 2017 国 C] 分考场(假题:最小色数)
[蓝桥杯 2017 国 C] 分考场(假题:最小色数)
Description
people are taking a special exam.
To ensure fairness, any two people who know each other cannot be assigned to the same exam room.
Find the minimum number of exam rooms needed to satisfy this condition.
Input Format
The first line contains an integer , which is the number of people taking the exam.
The second line contains an integer , meaning that there are lines of data following.
Each of the next lines has the format: two integers , , separated by a space , indicating that person knows person (numbering starts from ).
Output Format
Output one integer on a single line, representing the minimum number of exam rooms.
5
8
1 2
1 3
1 4
2 3
2 4
2 5
3 4
4 5
4
5
10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
5
Hint
Time limit: 1 second, 256M. Lanqiao Cup 2017, the 8th National Finals.
Translated by ChatGPT 5
京公网安备 11011102002149号