3 人解决,4 人已尝试。
12 份提交通过,共有 39 份提交。
8.1 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
HH,LL and TT are three bad friends. But their houses are very near from each other. They want to put some barriers so that their houses couldn’t connect together.
“H” on the map indicates HH’s house,”L” indicates LL’s house ,”T” indicates TT’s house,”.” indicates free space and you could put a barrier on it. .”X” indicate a barrier.
If there are three or more free spaces connect to one’s house,the house is not save. No one will live on an unsave house.And I sure the three boys must live on save houses.
Now, tell you the information of the map, please help the three Poor boys to calculate the minimum barriers they need to put so that their houses couldn’t connect together.
The first line with two numbers n and m(0<n,m<10) stands for the size of the map;then n lines follow ,each line with m characters.There are exact one “H”,one “L” and one “T”.
And I ensure the number of “X” will not exceed 5.
There are no more then 30 cases.
Output the minimum barriers they need to put.If there is no way to separate them ,just output “Impossible”.
5 5 ..... H.... XX.XX ..... .LXT. 3 5 LX.X. ..HT. .XXX.
1 Impossible
3 人解决,4 人已尝试。
12 份提交通过,共有 39 份提交。
8.1 EMB 奖励。
创建: 15 年,4 月前.
修改: 7 年,3 月前.
最后提交: 4 年前.
来源: N/A