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

建议使用的浏览器:

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

2640:Toy bricks

题目描述
When Teddy was a child,he liked playing toy bricks very much.And he had found an interesting way to play with those toy bricks.
There is a big plate with some blocks in it,of course you can't put the bricks in the block,you can only put the the bricks in the place which is empty.
To make the problem easier I only give you one kind of brick:

@
@@@
@

and I will give you the box's initial state as below:


...####..
...###..#
..####..#
...####..

the '#' means the block and the '.' means the empty place.
To play this game,simply,you just need to put as many bricks to the box as you can.
OK,just tell me what is the maximum number of bricks can be put into the box ^_^.
输入解释
The first line contain a T followed by T cases.
The first line of each case,there are two integers n,m,indicating the Height adn the Width of the box.(n <= 100 , m <= 8).
then n lines strings each with m characters give the initial stae of the box.
There will be one blank line after each case.
输出解释
One integer per line indicating the maximum number of bricks.
输入样例
1
5 4
#.#.
...#
#..#
#...
##.#
输出样例
2
来自杭电HDUOJ的附加信息
Author teddy
Recommend teddy

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

题目来源 百万秦关终属楚

源链接: HDU-2640

最后修改于 2020-10-25T22:55:28+00:00 由爬虫自动更新

共提交 0

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