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

建议使用的浏览器:

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

3500:Youth Hostel Dorm

Special Judge 特殊评判
题目描述

The Utrecht Youth Hostel has a giant dorm which usually accommodates all customers easily. With nwerc in town, however, lots of people would like to stay there and all the space available in the dorm should be used as efficiently as possible. You are assigned to provide the dorm layout.

The size of the dorm is given and the layout should consist of a map of that particular size. The map should display one ‘E’, the point of entrance of the dorm, and furthermore ‘B’s and ‘.’s, indicating beds and empty spaces. The entrance should be located somewhere on the boundary of the dorm and every single bed should be reachable by starting at the entrance and walking through empty squares only. You can only walk in vertical and horizontal directions.

The provided layout should contain as many beds as possible.

输入解释

On the first line one positive number: the number of testcases, at most 100. After that per testcase:

  • One line with two integers l and w with 1 ≤ l, w ≤ 8: the size of the dorm.
输出解释

Per testcase:

  • l lines with w characters: the dorm layout. Any layout with the maximum number of beds is correct.
输入样例
3
1 1
4 7
3 8
输出样例
E
B.B.BEB
B.BBB.B
B.....B
B.BBB.B
BBBBBBBB
.......E
BBBBBBBB

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3500

最后修改于 2020-10-29T07:03:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536