ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

第四篇英语翻译

2022-01-19 10:03:59  阅读:240  来源: 互联网

标签:doors treasure 迷宫 Acm 英语翻译 maze 第四篇 find


重点词汇:

terminate v.结束,终止,达到终点站。

layout n.布局,设计,排版。

maze n,迷宫。v.发晕,使迷惑。

出处:https://acs.jxnu.edu.cn/problem/NOIOPJCH02051159

Maze

 2000ms  65536K

描述:

Acm, a treasure-explorer, is exploring again. This time he is in a special maze, in which there are some doors (at most 5 doors, represented by 'A', 'B', 'C', 'D', 'E' respectively). In order to find the Acm是一个宝藏探索家,这一次他又在探索了。这一次他来到了一个有一些门的特殊迷宫(迷宫中最多有5个门,分别用'A', 'B', 'C', 'D', 'E'代表)。   treasure, Acm may need to open doors. However, to open a door he needs to find all the door's keys (at least one) in the maze first. For example, if there are 3 keys of Door A, to open the door he 为了找到宝藏,Acm需要打开这些门。 然而,要打开这些门他第一部需要在迷宫中找到全部门的钥匙(至少一个钥匙)。  举个例子,如果开A门需要3把钥匙,为了开这个门他需要先找到这3把钥匙 should find all the 3 keys first (that's three 'a's which denote the keys of 'A' in the maze). Now make a program to tell Acm whether he can find the treasure or not. Notice that Acm can only go up, down, (用三个“a"代表在迷宫中门"A"的三把钥匙)                                                                       现在编写一个程序告诉Acm他是否能找到宝藏。注意Acm在迷宫中只能往上走,往下走,往左和右走 left and right in the maze.

输入:

The input consists of multiple test cases. The first line of each test case contains two integers M and N (1 < N, M < 20), which denote the size of the maze. The next M lines give the maze layout, with each line containing N characters. A character is one of the following: 'X' (a block of wall, which the explorer cannot enter), '.' (an empty block), 'S' (the start point of Acm), 'G' (the position of treasure), 'A', 'B', 'C', 'D', 'E' (the doors), 'a', 'b', 'c', 'd', 'e' (the keys of the doors). The input is terminated with two 0's. This test case should not be processed.

输入包含多组数据。每一组数据的第一行包含两个整数 M 和N ,代表着迷宫的大小。 接下来的M行给出迷宫的布局,每一行包含N个元素。每一个元素有如下情况:“X”(代表一道墙),

“。”(代表一个空地区),“S”(代表Acm的出发点),“G”(宝藏的地点),“A,B,C,D,E”(代表门),“a,b,c,d,e”(代表门的钥匙)。以输入两个0为结束。

输出:

For each test case, in one line output "YES" if Acm can find the treasure, or "NO" otherwise. 对于每一组测试数据,输出一行“YES”当Acm能找到宝藏,否则输出"NO"。

样例输入:

4 4 
S.X. 
a.X. 
..XG 
.... 
3 4 
S.Xa 
.aXB 
b.AG 
0 0

样例输出:

YES 
NO

标签:doors,treasure,迷宫,Acm,英语翻译,maze,第四篇,find
来源: https://www.cnblogs.com/cilinmengye/p/15821020.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有