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

            久久国产精品99久久久久久老狼| 99久久精品免费看国产一区二区三区 | 久久久99精品一区二区| 99热都是精品久久久久久| 久久精品国产99久久久香蕉| 性做久久久久久久久浪潮| 粉嫩小泬无遮挡久久久久久| 国产成人香蕉久久久久| 97视频久久久| 久久久网中文字幕| 久久精品一本到99热免费| 久久乐国产精品亚洲综合| 九九久久自然熟的香蕉图片| 日本欧美国产精品第一页久久| 亚洲国产另类久久久精品黑人| 办公室久久精品| 亚洲愉拍99热成人精品热久久 | 99久久精品费精品国产| 久久香综合精品久久伊人| 久久亚洲国产午夜精品理论片| 欧美伊人久久大香线蕉综合 | 久久亚洲高清综合| 久久精品成人国产午夜| 亚洲国产精品无码久久久蜜芽| 日本加勒比久久精品| 99精品伊人久久久大香线蕉| 久久人人爽人人爽人人片AV不| 久久久这里有精品| 久久天天躁狠狠躁夜夜2020老熟妇| 狠狠色婷婷综合天天久久丁香 | 午夜精品久久久久成人| 国产精品久久久久久久久鸭| 亚洲欧美日韩久久精品第一区| 亚洲精品第一综合99久久| 四虎久久影院| 久久久久久久91精品免费观看| 久久男人AV资源网站| 一级做a爰片久久毛片毛片| 亚洲国产精品综合久久网络| 久久人妻少妇嫩草AV蜜桃| 色综合久久久久综合99|