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

建议使用的浏览器:

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

3545:Board Coloring

题目描述
HH is painting a board of size 4 * N. You can assume the color of square (X, Y) on the board is Ax,y which is an integer between 0 and 255. For the beauty of the board, HH decide to paint the board following the rules :
1) Ax,y >= Ax,y-1.
2) For some given pairs of (X1, Y1) (X2, Y2), AX1,Y1 = AX2,Y2
Your task is to calculate how many ways there are to paint the board.
输入解释
There are multiple test cases, the first line of input contains a single integer denoting the number of test cases.
For each test case, the first line contains an integer N and M, denoting the length of the board and the number of additional rules. (1 <= N <= 15, 0 <= M <= 100)
For next M lines, each line contains four integers X1, Y1, X2, Y2 denoting one additional rule for the painting. (1 <= X1, X2 <= 4, 1 <= Y1, Y2 <= N)
输出解释
For each test cases, you are to output the number of ways of painting. Because there may be too many ways, you are only to output the last five digits. See sample output for further details.
输入样例
3
1 0
1 3
1 1 2 1
1 1 3 1
4 1 3 1
2 6
1 1 2 1
1 1 3 1
1 1 4 1
1 2 2 2
1 2 3 2
1 2 4 2
输出样例
Case 1: 67296
Case 2: 00256
Case 3: 32896
来自杭电HDUOJ的附加信息
Author HyperHexagon
Recommend zhengfeng

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

源链接: HDU-3545

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

共提交 0

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