作业帮 > 综合 > 作业

英语翻译Clickomania is a puzzle in which one starts with a recta

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/06 20:12:50
英语翻译
Clickomania is a puzzle in which one starts with a rectangular grid of cells of different colours.In each step,a player selects ("clicks") a cell.All connected cells of the same colour as the selected cell (including itself) are removed if the selected cell is connected to at least one other cell of the same colour.The resulting "hole" is filled in by adjacent cells based on some rule,and the object of the game is to remove all cells in the grid.In this problem,we are interested in the one-dimensional version of the problem.The starting point of the puzzle is a string of colours (each represented by an uppercase letter).
At any point,one may select (click) a letter provided that the same letter occurs before or after the one selected.The substring of the same letter containing the selected letter is removed,and the string is shortened to remove the hole created.To solve the puzzle,the player has to remove all letters and obtain the empty string.If the player obtains a non-empty string in which no letter can be selected,then the player loses.For example,if one starts with the string "ABBAABBAAB",selecting the first "B" gives "AAABBAAB".Next,selecting the last "A" gives "AAABBB".Selecting an "A" followed by a "B" gives the empty string.On the other hand,if one selects the third "B" first,the string "ABBAAAAB" is obtained.One may verify that regardless of the next selections,we obtain either the string "A" or the string "B" in which no letter can be selected.Thus,one must be careful in the sequence of selections chosen in order to solve a puzzle.Furthermore,
there are some puzzles that cannot be solved regardless of the choice of selections.For example,"ABBAAAAB" is not a solvable puzzle.Some facts are known about solvable puzzles:The empty string is solvable.If x and y are solvable puzzles,so are xy,AxA,and AxAyA for any uppercase letter
A.All other puzzles not covered by the rules above are unsolvable.
Given a puzzle,your task is to determine whether it can be solved or not.
英语翻译Clickomania is a puzzle in which one starts with a recta
Clickomania是一道难题,其中一个人开始用不同颜色的细胞的矩形网格.在每一步中,玩家选择(“点击”)一间牢房.相同颜色的所有连接为选定的单元格(包括本身)细胞被删除选定的单元格,如果是连接到至少一个相同颜色的其他细胞.由此产生的“洞”是填写的某些规则的基础上相邻的单元格,以及游戏的目标是消除所有单元格.在这个问题中,我们感兴趣的问题的一维的版本.难题的出发点是色彩字符串(各由一个大写字母表示).在任何时候,人们可以选择(点击)条规定,在同一封信中之前或之后出现的一个选择.同一包含选定的被删除,并且该字符串缩短为消除洞创建.为了解决这一难题,玩家必须删除所有的信件,并取得空字符串.如果玩家获得一个非空的字符串,其中没有字母可以选择,然后玩家损失.例如,如果一开始字符串“ABBAABBAAB”,选择第一个“乙”给“AAABBAAB”.接下来,选择最后一个“甲”给“AAABBB”.选择一个“A”的一个“B”给空字符串.另一方面,如果一个人选择了第三个“B”的第一,字符串“ABBAAAAB”获得.人们可以确认的选择,无论未来,我们得到无论是字符串“A”或字符串“B”的信中,没有可以选择.因此,人们必须在按顺序选择解决一个难题的选择顺序小心.此外,还有一些不能得到解决,无论是选择的选择难题.例如,“ABBAAAAB”不是一个可解谜.有些事实是已知约可解的难题:空字符串是可以解决的.如果x和y是可解的难题,所以都向阳,安盛,和AxAyA大写字母A的任何不守规矩涵盖的所有其他上述难题无法解决.给定一个谜,你的任务是确定是否能够解决.