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

            統計

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

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            基礎深搜題

              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久久aaa一级毛片| 国产成人精品综合久久久| 2022年国产精品久久久久| 狠狠色丁香久久综合五月| 精品久久久无码人妻中文字幕豆芽| 久久99热这里只有精品66| 无码AV波多野结衣久久| 久久av免费天堂小草播放| 欧美一区二区久久精品| 国内精品久久久久久99蜜桃| 国产亚州精品女人久久久久久| 久久久久亚洲AV片无码下载蜜桃 | 久久久久国产一区二区| 性做久久久久久久久浪潮| 国产69精品久久久久9999| 久久免费视频1| 国产精品99久久不卡| 久久久久亚洲AV片无码下载蜜桃| 精品久久综合1区2区3区激情 | 亚洲精品tv久久久久久久久| 久久夜色tv网站| 欧美黑人又粗又大久久久| 狠狠色丁香久久婷婷综合_中| 国产精久久一区二区三区| 久久久青草久久久青草| 久久一日本道色综合久久| 一本久久a久久精品亚洲| 日本加勒比久久精品| 国产—久久香蕉国产线看观看 | 久久这里只有精品久久| 久久久久成人精品无码中文字幕| 久久经典免费视频| 亚洲а∨天堂久久精品9966| 久久国产香蕉一区精品| 国产巨作麻豆欧美亚洲综合久久 | 久久精品中文字幕一区| 亚洲国产天堂久久久久久| 久久丝袜精品中文字幕| 久久影院久久香蕉国产线看观看| 久久综合给合综合久久| 久久伊人精品一区二区三区|