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

26251번 - Restrooms 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB3000.000%

문제

MIPT university administration is planning to make repairs in the main corridor. Above all, they are going to repair all $n$ restrooms located along the corridor and numbered from 1ドル$ to $n$. Initiative group of MIPT students and professors has made several requests of the following types:

  • There should be at least one women's restroom in the segment between $l_i^{th}$ to $r_i^{th}$ restroom inclusive.
  • There should be at least one men's restroom in the segment between $l_i^{th}$ to $r_i^{th}$ restroom inclusive.

You should answer if it is possible to satisfy all these requests, and, in case it is possible, output any possible arrangement.

입력

In the first line you are given three integers $n, w, m$ (1ドル\le n\le 10^6,ドル 0ドル\le w, m \le 10^6$) --- number of restrooms, number of requests for women's restroom, number of requests for men's restroom respectively.

In the next $w+m$ lines you are given descriptions of requests, first about women's restrooms, then about men's restrooms. Description of one request consists of two integers $l_i, r_i$ (1ドル\le l_i \le r_i \le n$).

출력

In the first line output string <<Yes>> (without quotes), if the way to satisfy all requests exists and <<No>> (without quotes), if it is impossible. If answer is yes, then output in the second line string consisting of $n$ zeros and ones, describing possible way of assigning restrooms to be men's (1) and women's (0).

제한

예제 입력 1

3 1 1
1 1
3 3

예제 출력 1

Yes
001

예제 입력 2

3 1 1
1 1
1 1

예제 출력 2

No

예제 입력 3

1 3 0
1 1
1 1
1 1

예제 출력 3

Yes
0

힌트

출처

Contest > Open Cup > 2016/2017 Season > Stage 7: Grand Prix of Dolgoprudny F번

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

출처

대학교 대회

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

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