• <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

            久久噜噜电影你懂的| 久久久WWW成人| 精品久久久久久中文字幕人妻最新| av色综合久久天堂av色综合在| 少妇内射兰兰久久| 亚洲乱亚洲乱淫久久| 亚洲国产精品无码久久青草| 亚洲精品高清国产一线久久| 97精品伊人久久久大香线蕉| 久久精品国产男包| 精品久久久久中文字| 国内精品久久久久久久久电影网| 99久久国产综合精品麻豆| 久久久WWW成人免费精品| 99久久国产综合精品麻豆| 囯产极品美女高潮无套久久久 | 久久超碰97人人做人人爱| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 久久综合狠狠色综合伊人| 久久久亚洲精品蜜桃臀| 成人资源影音先锋久久资源网| 青草久久久国产线免观| 国产精品久久久久久久久| 亚洲国产另类久久久精品黑人 | 久久亚洲精品无码aⅴ大香| 狼狼综合久久久久综合网| 亚洲国产日韩欧美久久| 久久久九九有精品国产| 久久久无码精品亚洲日韩京东传媒 | 精品国产乱码久久久久久郑州公司 | 午夜精品久久影院蜜桃| 88久久精品无码一区二区毛片| 久久久久国产精品人妻| 亚洲国产精品成人久久蜜臀 | 亚洲精品乱码久久久久久蜜桃不卡 | 亚洲AV成人无码久久精品老人 | 99国产欧美久久久精品蜜芽 | 免费一级欧美大片久久网| 日韩欧美亚洲综合久久影院d3| 亚洲国产精品久久久久婷婷老年| 久久99国产精品久久久 |