Chessboard------最大独立数
来源:互联网 发布:淘宝怎么设置折扣 编辑:程序博客网 时间:2024/05/22 08:05
Chessboard
Total Submit:12 Accepted:12
Description
Alice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2 to cover the board. However, she thinks it too easy to bob, so she makes some holes on the board (as shown in the figure below). We call a grid, which doesn’t contain a hole, a normal grid. Bob has to follow the rules below: A VALID solution. An invalid solution, because the hole of red color is covered with a card. An invalid solution, because there exists a grid, which is not covered. Your task is to help Bob to decide whether or not the chessboard can be covered according to the rules above.
1. Any normal grid should be covered with exactly one card.
2. One card should cover exactly 2 normal adjacent grids.
Some examples are given in the figures below:
Input
There are 3 integers in the first line: m, n, k (0 < m, n <= 32, 0 <= K < m * n), the number of rows, column and holes. In the next k lines, there is a pair of integers (x, y) in each line, which represents a hole in the y-th row, the x-th column.
Output
If the board can be covered, output "YES". Otherwise, output "NO".
Sample Input
2 1
3 3
Sample Output
Hint
A possible solution for the sample input.
Source
HHUACM
- Chessboard------最大独立数
- Chessboard 二分图最大匹配 极大独立集
- HDU 1068 最大独立数(最大独立数 = 顶点数 - 最大匹配数/2)
- HDU1068Girls and Boys(最大独立数)
- 【最大匹配】Chessboard POJ2446
- poj2446 Chessboard【最大匹配】
- [网络流][最大点权独立集] 方格取数
- hdu2458(二分图+最大独立数+匈牙利算法)
- hdu1569 方格取数 求最大点权独立集
- 【最大点权独立集】【HDU1565】【方格取数】
- 方格取数(2)(最大点权独立集)
- 【codevs1907】方格取数3 最大点权独立集
- hdu 1569 方格取数 点最大独立集
- 【BZOJ 1475】方格取数 最大点权独立集
- [hdu1569]方格取数(2) 最大点权独立集
- BZOJ 1475: 方格取数 最大点权独立集
- POJ 2446 Chessboard 最大匹配
- 匈牙利最大匹配 poj2446 Chessboard
- XML学习指导
- SDIO接口
- R12 客户表结构
- Java静态初始化,实例初始化以及构造方法
- 怎样判断网站被降权了?养成好习惯
- Chessboard------最大独立数
- 生活的无奈
- 关于virtualbox的shared folder
- 月结心得
- 关于时间Datetime的处理。
- 这几天想要做的事情
- 2010年8月25日
- 业界功能最全的免费版测试管理工具XStudio
- powerDesigner 使用方法