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

建议使用的浏览器:

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

5851:Honey Tour

题目描述
A little bear Koma likes honey very much. One day, Koma finds a storehouse full of honey. The storehouse has M entrances and exits, is very complicated like a maze. But Koma understands the structure of the storehouse which it is K downwards repetitions of N*M grid, there are some obstacles and the other grids has a honey pot, M entrances are at the top sides of top grid cells and M exits are at the bottom sides of bottom grid cells.

Koma decides to tour in the storehouse following rules.

1.  Koma enters the storehouse through one of the entrances.
2.  Koma can move by one of 4 adjacent directions, cannot go through the obstacles and no grid can be visited more than once.
3.  Koma can eat a honey pot on his position.
4.  Koma can go out through one of the exits.

Koma wants to eat as much honey as possible and he wants to know maximum number of honey pot he can eat when he enters by ith entrance and go out by jth exit and number of that tour.
输入解释
First line contains an integer T, number of test cases.

For each test case, there are 3 integers N, M, K.

And there are N lines which contains M characters.

‘.’means a grid cell which has honey pot and ‘X’ means a obstracle.

1 <= N <= 5
2 <= M <= 7
2 <= N * M <= 25
1 <= K <= 1000000000
输出解释
For each test case, first line contains a line “Case #x:”, x is the number of the case.

And then you should output two M * M matrices, first is number of honey pot and second is number of that tour.

ith line of jth number is for the case such that he enters by ith entrance and go out by jth exit.
输入样例
1
2 2 2
..
.X
输出样例
Case #1:
4 0
5 0
1 0
1 0

提示
The store house is actually like this.
SS
..
.X
..
.X
TT
S is entrance and T is exit.

And tour is like this.
SS
|.
|X
|.
|X
TT

SS
|-
|X
|.
|X
TT
来自杭电HDUOJ的附加信息
Author 金策工业综合大学(DPRK)
Recommend wange2014

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

源链接: HDU-5851

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

共提交 0

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