翻译1.19

原网址:Biggest Number - C语言网  https://www.dotcpp.com/oj/problem1077.html

You have a maze with obstacles and non-zero digits in it://你有一个迷宫,迷宫由障碍和非零数字组成

 

 

You can start from any square, walk in the maze, and finally stop at some square. Each step, you may only walk into one of the four neighbouring squares (up, down, left, right) and you cannot walk into obstacles or walk into a square more than once.

//你可以从任何地方开始走这个迷宫,任何地方结束走这个迷宫。每一次走,你只可以走所在各自的相邻的上下左右中的一个,但是要求你不可以在有障碍和走过一次的地方走。

When you finish, you can get a number by writing down the digits you encounter in the same order as you meet them. For example, you can get numbers 9784, 4832145 etc. The biggest number you can get is 791452384, shown in the picture above.

 //走完之后,你可以得到一串根据你走的路线(走过方块上的数字的顺序)而得到的数字。例如

9784,4832148等等。在照片所示的迷宫中你能得到的最大数字是791452384。

Your task is to find the biggest number you can get.

// 你的任务就是找到最大数字。

输入

 There will be at most 25 test cases. Each test begins with two integers R and C (2<=R,C<=15,R*C<=30), the number of rows and columns of the maze.

//一共有<=25个测试样例。每一个测试样例由2个数字R和C开头(2<=R,C<=15,R*C<=30),

R和C分别代表方格的行数和列数。

The next R rows represent the maze. Each line contains exactly C characters (without leading or trailing spaces), each of them will be either '#' or one of the nine non-zero digits. 

//接下里的R行代表迷宫的组成。每一行包括C个字符(前后没有空格),每一个字符可能是“#”或者是1到9九个数字。

There will be at least one non-obstacle squares (i.e. squares with a non-zero digit in it) in the maze. The input is terminated by a test case with R=C=0, you should not process it.

 //题目保证至少有一条没有障碍(#)的路可以完成迷宫(????).输入以两个零结束,你不应该处理它。

输出

 For each test case, print the biggest number you can find, on a single line.

样例输入复制
<span style="color:#333333"><span style="color:#333333">3 7
##9784#
##123##
##45###
0 0
</span></span>
样例输出复制
<span style="color:#333333"><span style="color:#333333">791452384</span></span>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值