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

建议使用的浏览器:

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

3536:PAINTING

题目描述
We are going to cover a wall (whose area is r*c) with m different kinds of oil paint ( that is also m kinds of colors ). In order to simplify the problem, we will regard the wall as a set of r*c small squares. The area of one small square is 1 and a small square could be expressed as (x , y) (1<=x<=r, 1<=y<=c).
So every time when we are painting some selected area, we are covering the small squares in that area with a particular color.
Your task is to calculate the number of colors which are completely covered after m times of painting.
For example, given a rectangular area of a upper left corner (x1, y1) and a lower right corner (x2, y2)
输入解释
Multiple test cases, end with EOF.
In every test case:
In the first line, there will be 3 integers: r c m. r and c are the length and width of the wall , and m is the number of colors of the oil paint. Each type of the oil paints has its own different color.
Then there will be m lines followed, and the ith line has 4 integers: x1 y1 x2 y2, which means that we will cover the rectangular area of a upper left corner (x1, y1) and a lower right corner (x2, y2) with the ith color.
输出解释
One number, how many colors are completely covered after all the m rectangular areas are painted .

输入样例
3 3 3
1 1 2 2
1 3 3 3
1 1 3 3
输出样例
2
来自杭电HDUOJ的附加信息
Recommend zhouzeyong

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

源链接: HDU-3536

最后修改于 2020-10-25T23:04:32+00:00 由爬虫自动更新

共提交 0

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