Logo
(追記) (追記ここまで)

16106번 - Grievous Loss of Data 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 512 MB83292156.757%

문제

Something has gone very wrong with the lecture scheduling system at the University of Competitive Programming (UCP), which has resulted in a large loss of data. The lecture scheduling system’s job is to assign lecture halls to lectures. Unfortunately, the algorithm that was implemented to do this task has gone completely haywire, and has started displaying a very convoluted error message. No one has been able to decipher the error message, but everyone agrees it seems to be some sort of very long, colourful, and immersive proof. Luckily, some of the information has been recovered.

From the recovered data, we have determined that there are N lectures today, each of which takes up a single, contiguous interval of time. Some of these lectures may clash, which means that their time intervals intersect. Unfortunately, the information describing which interval of time each lecture requires has been lost! Fortunately, we have been able to determine which pairs of lectures clash.

If two lectures clash, they need to be assigned to different lecture halls. At the UCP, there is a limited number of lecture halls, and all the lectures must be assigned a hall. People will start arriving for the lectures soon. Can you help to find the minimum number of lecture halls needed such that every lecture can be assigned to a hall?

입력

The first line of input contains two integers N (1 ≤ N ≤ 200 000), which is the number of lectures, and M (0 ≤ M ≤ 200 000), which is the number of clashes.

The next M lines describe the clashes. Each of these lines contains two integers u and v (1 ≤ u < v ≤ N), which describe a pair of lectures that clash. It is guaranteed that there is a set of N lectures that have exactly the M clashes given. Each clash is unique and will appear exactly once in the input.

출력

Display the minimum number of lecture halls required.

제한

예제 입력 1

3 0

예제 출력 1

1

예제 입력 2

5 6
1 2
2 3
1 4
1 5
2 4
2 5

예제 출력 2

3

예제 입력 3

4 5
1 2
1 3
1 4
2 3
2 4

예제 출력 3

3

힌트

출처

ICPC > Regionals > South Pacific > South Pacific Region > 2017 ACM South Pacific Programming Contest G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /