- 1、本文档共14页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
An escape
Time Limit: 2000/1000 MS (Java/Others)????Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 227????Accepted Submission(s): 56
Problem Description
You are now in a maze. You mark all the blocks youve visited by @, so when you see a wall # or a visited block @ in front of you, you will make a right turn. Otherwise, that means you dont have a wall or a visited block in front, youll go forward. When you reach the door D, congratulations!#####Y@###D#####Look at the maze above, you are now in Y, facing left, and seeing a wall in front of you. You turn right, a wall again; turn right again, visited block; turn right once again, still a wall. After three continuous turnings, you realize the rest time of your life will be making turnings.
?
Input
The first line is T(T=20), then T cases follow.Each case has two numbers n and m(4=n,m = 20), the boundary of the maze will always be #, in the maze, there will be exactly one Y, one D. Normal blocks are marked with ..At first you are facing left.
?
Output
YES if you can go out of the maze(reach D). NO otherwise.
?
Sample Input
2
4 4
####
#.Y#
##D#
####
4 4
####
#.Y#
#D##
####
?
Sample Output
NO
YES
?
Author
MadFroG
Beautiful numbers
Time Limit: 2000/1000 MS (Java/Others)????Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 152????Accepted Submission(s): 41
Problem Description
You need to write a program which generates consecutive positive integers. Only certain digits may appear in the input and in the integers generated, and leading zeros arent allowed. And we call these numbers beautiful numbers.You are given a sequence containing the list of allowed digits, and an integer representing the current integer. Output a integer representing the first integer larger than current one consists of allowed digits only.If current represents an invalid integer according to the first paragraph, output INVALID INPUT (quotes for clarity).
?
Input
The input begins with an integer T(1=T=100). T
文档评论(0)