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

建议使用的浏览器:

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

4480:Rectangles

题目描述
  There is a big N * M rectangle consists of N * M unit squares, and each unit square has an integer value 0 or 1 on it. N and M may be very large, but the number of unit squares which have value 1 on it, is not more than 100.
  You task is to calculate how many different rectangles (which consist of some complete unit squares) satisfy that the values on its unit squares are all 0.
  We say two rectangles are different if and only if they have different size or they are in different location.
输入解释
  There is an integer T (1 <= T <= 200) in the first line, which indicates that there are T test cases in total.
  For each test case, there are three integers N (1 <= N <= 1000000000), M (1 <= M <= 1000000000), K (0 <= K <= 100, K <= N * M). N and M have the same meanings as above. K means there are exactly K unit squares which have value 1 on it, surely that the other unit squares have value 0 on it. Then there are following K lines and each line has two integer x (1 <= x <= N), y (1 <= y <= M), means that the unit square in row x and column y has value 1 on it. You can assume that no two pairs of x and y are the same.
There are at most 10 test cases that satisfy N > 100 or M > 100 or K > 15.
输出解释
  For each test case, you should output the correct answer of the above task.
  Because the answer may be very large, you should just output the remainder of it divided by 1000000007 instead.
输入样例
3
1 1 0
2 2 0
2 3 2
1 1
2 3
输出样例
1
9
7
提示
For Sample 3, the yellow unit squares in Figure 1 show you the 7 rectangles.
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-4480

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

共提交 0

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