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

23064번 - L-triominoes 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 512 MB3013736.842%

문제

Luka stumbled upon a rectangular board of height $H$ and width $W$ divided into $W \times H$ unit squares. He quickly noticed that exactly $K$ of those unit squares are missing.

Interestingly enough, Luka just happens to have an infinite supply of L-shaped triominoes. Is it possible to tile the given board using these triominoes?

We consider the board to be correctly tiled if each unit square of the board is covered by a triomino square. Additionally, triominoes must not cover any of the missing squares, and should not overlap or stick out of the board. Of course, triominoes can be arbitrarily rotated by multiples of 90 degrees.

입력

The first line contains three integers $W,ドル $H$ and $K$ (0ドル \le K \le W \cdot H$) from the task description.

The $i$-th of the next $K$ lines contains two integers $x_i$ (1ドル \le x_i \le W$) and $y_i$ (1ドル \le y_i \le H$), representing the coordinates of the $i$-th missing square. The given missing squares are pairwise distinct.

출력

If Luka can successfully tile the given board, output "YES" in a single line. Otherwise, output "NO" in a single line.

제한

서브태스크

번호배점제한
110

2ドル \le W \le 13,ドル 2ドル \le H \le 1,000円,ドル $K \le 250$

27

2ドル \le W \le 13,ドル 2ドル \le H \le 10^9,ドル $K = 0$

311

2ドル \le W \le 3,ドル 2ドル \le H \le 10^9,ドル $K \le 250$

417

4ドル \le W \le 6,ドル 2ドル \le H \le 10^9,ドル $K \le 250$

535

7ドル \le W \le 13,ドル 2ドル \le H \le 10^9,ドル $K \le 250$

620

2ドル \le W \le 13,ドル 2ドル \le H \le 10^9,ドル $K \le 250$

예제 입력 1

4 3 3
1 1
1 3
4 3

예제 출력 1

YES

예제 입력 2

5 2 4
1 2
2 1
5 1
5 2

예제 출력 2

NO

Luka cannot place a valid triomino which tiles square (1, 1).

예제 입력 3

2 3 0

예제 출력 3

YES

힌트

출처

Olympiad > Central European Olympiad in Informatics > CEOI 2021 > Day 1 2번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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