当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3026:Chinese Chess

题目描述
Winnie is very interested in chinese chess. Now, let's consider a game which is similar to it. There is a N * M chess board, we hope we can put rooks as more as possible. But just a certain number of postions can be put rooks on. One rook can attack another if they are in the same row or column. Now you may think this is a very simple problem for you. But as very whuacmers know, winnie is evil enough to cheat you. Let's consider some positions called critical postions. If we don't put rook on the critical position, the maximum number of rook we can put on this chess board will reduce. How many critical positions on the chess board?
输入解释
Input will contain multiple test cases. The first line contains three numbers N, M, K(N, M ≤ 10000, K ≤ 100000) which indicate height, width and number of positions which can be put rook on. Then next K lines follow, each contains two integer X ans Y which indicate we can put rook on the Xth row, Yth column.
输出解释
Output as follow:

Board T have C important blanks for L chessmen.

C indicate the number of critical positions ans L indicate the maximum rooks can be put.
输入样例
3 3 4
1 2
1 3
2 1
2 2
3 3 4
1 2
1 3
2 1
3 2 
输出样例
Board 1 have 0 important blanks for 2 chessmen.
Board 2 have 3 important blanks for 3 chessmen. 

提示
Hint: huge input, use scanf please.
来自杭电HDUOJ的附加信息
Recommend gaojie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3026

最后修改于 2020-10-25T22:59:21+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
30000/15000MS(Java/Others) 32768/32768K(Java/Others)