• <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>
            付翔的專(zhuān)欄
            在鄙視中成長(zhǎng) 記錄成長(zhǎng)的點(diǎn)滴
            posts - 106,  comments - 32,  trackbacks - 0

            http://acm.hdu.edu.cn/showproblem.php?pid=3368

            # include
            <stdio.h>
            # include
            <math.h>
            # include
            <stdlib.h>
            # include
            <string.h>
            # include
            <ctype.h>
            # include
            <limits.h>
            # include
            <iostream>
            # include
            <algorithm>
            using namespace std;

            char map[9][9];
            int dir[8][2= {
                {
            0,-1},{1,-1},{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1}
            };

            bool isok(int x,int y)
            {
                
            if(x >= 0 && x < 8 && y >= 0 && y < 8)
                    
            return true;
                
            return false;

            }
            int search(int y,int x)
            {
                
            int i = 0,curx = x,cury = y,result = 0,max = 0;
                
            for(i = 0 ; i < 8 ; i ++)//往8個(gè)方向走
                {
                     curx 
            = x,cury = y;
                    
            while(isok(curx + dir[i][0],cury+dir[i][1]) && map[cury+dir[i][1]][curx + dir[i][0]] == 'L')
                    {
                        max 
            ++;
                        curx 
            +=dir[i][0];
                        cury 
            +=dir[i][1];
                    }
                    
            if(isok(curx + dir[i][0],cury+dir[i][1]) && map[cury+dir[i][1]][curx + dir[i][0]] == 'D')
                    {
                         result 
            += max;
                         max 
            = 0;
                    }
                    
            else max = 0;
                }
                
            return result;
            }
            int main()
            {    
                
            //freopen("in.txt","r",stdin);
                
            //freopen("out.txt","w",stdout);
                int T,caseId,i,j,k,t = INT_MIN,max = INT_MIN;
                cin
            >>T;
                
            for(caseId = 1; caseId <= T;caseId ++)
                {
                    
            for(i = 0; i < 8; i ++)
                        
            for(j = 0 ; j < 8; j ++)
                            cin
            >>map[i][j];
                    
                    
            for(t = 0,max = 0,i = 0; i < 8; i ++)
                    {
                        
            for(j = 0 ; j < 8; j ++)
                        {
                            
            if(map[i][j] == '*')
                                t 
            = search(i,j);
                            
            if(t > max)
                                max 
            = t;
                        }

                    }
                    printf(
            "Case %d: %d\n",caseId,max);
                }
                
                
            return 0;
            }


            這道 在建立坐標(biāo)系上 出了一些問(wèn)題  因?yàn)樵诰仃囍?第一的下標(biāo)表示行 那我們就習(xí)慣用X 表示行 我的程序設(shè)計(jì)的時(shí)候 用y 表示行 在思路轉(zhuǎn)換的過(guò)程中出了點(diǎn)小問(wèn)題
            posted on 2010-08-11 17:16 付翔 閱讀(214) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): ACM 數(shù)據(jù)結(jié)構(gòu)

            <2010年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            常用鏈接

            留言簿(2)

            隨筆分類(lèi)

            隨筆檔案

            文章分類(lèi)

            文章檔案

            CSDN - 我的blog地址

            博客

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            Xx性欧美肥妇精品久久久久久| 一级做a爰片久久毛片看看| 久久久久久久女国产乱让韩| 精品久久久久久久久免费影院| 中文字幕无码av激情不卡久久| 77777亚洲午夜久久多人| 99久久成人国产精品免费| 国产福利电影一区二区三区,免费久久久久久久精| 九九99精品久久久久久| 久久中文精品无码中文字幕| 久久人爽人人爽人人片AV| 国产叼嘿久久精品久久| 亚洲狠狠婷婷综合久久久久| 曰曰摸天天摸人人看久久久| 2021国内精品久久久久久影院| 久久精品国产99国产精偷| 久久免费看黄a级毛片| 91久久精品无码一区二区毛片| 狠狠色丁香久久婷婷综合| 久久久久亚洲AV综合波多野结衣 | 久久福利资源国产精品999| 久久永久免费人妻精品下载| 久久亚洲国产精品123区| 狠狠色丁香久久综合婷婷| 国产精品中文久久久久久久| 久久99久久无码毛片一区二区| 久久丫精品国产亚洲av| 精品国产99久久久久久麻豆| 久久久久这里只有精品| 国产精品伊人久久伊人电影| 久久亚洲精精品中文字幕| 99久久夜色精品国产网站| 久久大香萑太香蕉av| 少妇被又大又粗又爽毛片久久黑人 | 色综合久久88色综合天天| 岛国搬运www久久| 久久久青草久久久青草| 99久久精品国产麻豆| 色综合久久综合网观看| 国产成人精品久久亚洲| 国产精品永久久久久久久久久|