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

            亚洲午夜精品久久久久久浪潮 | 久久国产乱子伦精品免费午夜| 久久婷婷五月综合国产尤物app| 久久国产精品99国产精| 久久99精品国产麻豆不卡| 久久伊人色| 99久久久精品| 午夜精品久久久久久影视777| 国产精品久久久久蜜芽| 久久久无码一区二区三区| 国产精品免费久久久久电影网| 99久久精品国产一区二区| 99精品久久久久久久婷婷| 亚洲国产天堂久久久久久| 日产精品久久久一区二区| 久久久久国产精品嫩草影院| 亚洲愉拍99热成人精品热久久 | 一本久久a久久精品亚洲| 91精品国产91久久久久久青草| 久久精品中文字幕一区| 99久久婷婷国产综合精品草原| 久久久精品国产免大香伊| 国产午夜福利精品久久| 国产成人精品白浆久久69| 久久香综合精品久久伊人| 久久综合狠狠综合久久97色| 国产精品美女久久久久网| 久久久久成人精品无码中文字幕| 欧美精品一区二区久久| 久久精品国产亚洲精品| 91精品国产综合久久香蕉| 久久久久久综合一区中文字幕| 99久久免费国产特黄| 久久精品国产亚洲av水果派| 人妻精品久久久久中文字幕69| 亚洲精品成人网久久久久久| 久久夜色精品国产www| 久久露脸国产精品| 中文字幕精品无码久久久久久3D日动漫| 亚洲国产精品人久久| 精品乱码久久久久久夜夜嗨|