The Largest Circle
With the same friendship links, print the size of the largest circle.
Input: the first line has N and M; each of the next M lines has an edge u v (1-based).
Output: the maximum component size.
Constraints:
- 1 ≤ N ≤ 104
- 0 ≤ M ≤ 2×104
- multiple edges and self-loops may appear
Sample Tests
Input 1
5 3 1 2 2 3 4 5
Output 1
3
Input 2
2 0
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.