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

建议使用的浏览器:

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

3241:Guess the Pattern

Special Judge 特殊评判
题目描述
Given a 01 string, you can group consecutive 1’s into blocks and write down their lengths. This is called the ‘block length sequence (BLS)’ for that string. For example, the BLS for 011100110100011 is 3, 2, 1, 2.

Similarly, given a 01 matrix, you can write down the BLS for each row and each column. Given these BLS’s, your task is to restore the 01 matrix.

Rows are read from left to right, while columns are read from top to bottom. Each test case is guaranteed to be solvable, and you’re free to output any (but only one!) solution you like.
输入解释
The input contains at most 10 test cases. Each test case begins with two integers n and m (1 <= n, m <= 15), the number of rows and the number of columns. The next n lines contain the BLS’s for each row, from top to bottom, and the next m lines contains the BLS’s for each column, from left to right. Each BLS ends with zero. The input ends with n = m = 0.
输出解释
For each case, print exactly one feasible solution you find. Each row of the matrix should occupy exactly one line. There shouldn’t be any spaces within the matrix, nor there can be any empty lines between rows, but do print an empty after each test case.
输入样例
4 4
2 1 0
3 0
3 0
1 1 0
4 0
3 0
3 0
1 0
0 0
输出样例
**.*
***.
***.
*.*.
来自杭电HDUOJ的附加信息
Recommend zhonglihua

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

源链接: HDU-3241

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

共提交 0

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