• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Yiner的ACM

            成長的痕跡
            <2011年3月>
            272812345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            統(tǒng)計

            • 隨筆 - 29
            • 文章 - 0
            • 評論 - 2
            • 引用 - 0

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            基礎(chǔ)深搜題

              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 you've 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 don't have a wall or a
             visited block in front, you'll 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
            自己寫的超長代碼如下:

            深搜的代碼

            posted on 2011-03-13 11:30 Yiner 閱讀(404) 評論(0)  編輯 收藏 引用 所屬分類: DFS

            97久久国产亚洲精品超碰热| 久久精品aⅴ无码中文字字幕不卡| 色欲久久久天天天综合网精品| 欧美日韩精品久久久免费观看| 一本一本久久A久久综合精品 | 久久久久国产日韩精品网站| 精品视频久久久久| 亚洲综合伊人久久综合| 久久A级毛片免费观看| 久久久青草青青国产亚洲免观| 97久久精品国产精品青草| 久久青青国产| 精品久久久久久国产91| 亚洲国产日韩欧美久久| 国产毛片久久久久久国产毛片| 日本久久久久亚洲中字幕| 伊人久久五月天| 久久毛片一区二区| 91久久精品电影| 国产精品久久久久久久午夜片| 狠狠综合久久AV一区二区三区| 久久精品国产亚洲AV不卡| 久久亚洲AV成人无码国产| 99久久做夜夜爱天天做精品| 国产福利电影一区二区三区,免费久久久久久久精 | 久久午夜羞羞影院免费观看| 久久久精品国产| 久久久久久国产a免费观看黄色大片| 国产精品成人精品久久久| 久久国产高清字幕中文| 久久精品国产亚洲精品2020 | 久久精品99久久香蕉国产色戒 | 中文国产成人精品久久亚洲精品AⅤ无码精品| 久久久久亚洲AV无码永不| 精品久久亚洲中文无码| 国产精品亚洲综合久久| 人妻中文久久久久| 久久久精品国产免大香伊 | 精品久久人人妻人人做精品| 国产成人无码精品久久久久免费| 久久精品国产精品国产精品污 |