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

建议使用的浏览器:

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

2622:Everyone is No.1

题目描述
Everyone is No.1------ As long as there is belief in my heart, I will hold on until the last moment. Real hero, spirit never die!

See Figure 1, Teddy was in the left-up point, a ‘E’ represents a hole. Now, Teddy want to fill in all the hole. He has a special soil gun. When he shot, it can spread right or down at any time and fill the hole when it get through it, every shot must stop at the right-down point. See figure 2, Teddy should shot three times, but the more optimal solution was in the figure 3.

Figure 1

                  


Figure 2                                     Figure 3

Your task is to create a program that will determine the minimum number shots needed to fill all the hole, if you can’t have any solution about it, don’t fell sorry. Because Everyone is No.1, you can solve other problems first , then return to this problem, you will see it can be so easy.
输入解释
The input consists of one or more field maps. A field map consists of two parts:
Firstly, two integers n, m ( 1 <= n, m <= 24)
Secondly, a nXm matrix represent the map.

‘E’ represent the empty hole.
‘.’ represent the soil.
输出解释
The output will consist of a single line for each field map containing the minimum number of shot needed to fill in all the empty hole.
输入样例
6 7
.E.E...
...E.E.
.......
...E..E
.......
.....E.

2 2
EE
EE
输出样例
2
2
来自杭电HDUOJ的附加信息
Author WhereIsHeroFrom
Recommend zty

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

题目来源 醉卧沙场君莫笑

源链接: HDU-2622

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

共提交 0

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