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

5353번 - Open Intervals 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB59393766.071%

문제

Given n open intervals (a1, b1), (a2, b2), ..., (an, bn) on the number line, each representing start and end times of some activity requiring the same resource, the goal is to find the largest number of these intervals so that no two of them overlap.

입력

The input will contain multiple test cases. Each test case starts with a single line containing a positive integer, n ≤ 50, indicating the number of intervals. The next n lines each contain a pair of positive integers separated by one or more blanks. Each pair of integers represents one interval. The end-of-input is denoted by a line containing 0.

출력

For each test case print the largest number of intervals that do not overlap.

제한

예제 입력 1

5
10 12
2 6
5 8
3 9
1 4
2
1 3
3 5
0

예제 출력 1

3
2

힌트

출처

School > PLU High School Programming Contest > PLU 2013 > Advanced 11번

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

출처

대학교 대회

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

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