아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Alien Attack 2

시간 제한4초메모리 제한1024 MB

요약
n명의 사람과 m개의 친구 관계가 주어질 때, 한 번에 함께 데려가야 하는 최대 연결 성분의 크기를 구한다.
난이도

보통10점 중 5점

유형
그래프, DFS, 유니온 파인드
정답자
아직 제출이 없습니다

문제

Aliens are visiting Earth and, as usual, they plan to abduct humans for their experiments. In the past, alien abductions have caused a lot of press coverage and wild speculation on Earth. Luckily for them, most people do not believe these stories and think that aliens are not real.

In order to keep a low profile in the future, the Galactic Committee for Person Captures (GCPC) has established rules for abductions. Besides a lot of boring paperwork, the aliens have to prepare the abduction carefully. While they can make multiple trips (in fact, alien travel is so fast in practice that this is not a limitation at all), they must be smart about it so that their secret is not revealed to humans. If aliens want to abduct a person, they are required to abduct all of their friends at the same time, so that no one notices that their friend is missing when they want to hang out. Of course, friendships on planet Earth are bidirectional, that is if Alice is a friend of Bob, then Bob is also a friend of Alice.

In preparation for the trip, the aliens have observed their targets and started taking note of all their friendships. In total, they must abduct nn people, including their friends. Now, they want to book a starship at their local dealership and wonder how much space they need to abduct all nn people. A starship's storage space is measured in terms of the number of people that can be transported simultaneously. What is the minimum storage space required to abduct all nn people?

입력

The input consists of:

  • One line with two integers nn and mm (1≤n≤2⋅1051\leq n\leq 2 \cdot 10^5, 0≤m≤2⋅1050\leq m\leq 2 \cdot 10^5), the number of people and the total number of friendships between them.
  • mm lines, each with two integers ii and jj (1≤i<j≤n1\leq i < j\leq n), denoting a friendship between persons ii and jj.

The people are numbered from 11 to nn. It is guaranteed that no friendship is listed multiple times.

출력

Output the minimum storage space needed to abduct all people.

예제3

  1. 예제 1

    입력
    5 3
    1 2
    2 3
    4 5
    
    예상 출력
    3
    
  2. 예제 2

    입력
    3 0
    
    예상 출력
    1
    
  3. 예제 3

    입력
    8 8
    1 2
    2 3
    3 4
    1 4
    1 5
    2 6
    3 7
    4 8
    
    예상 출력
    8