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

            comiz

            re: 說題~[未登錄] comiz 2007-11-15 22:02
            24是因為之前排過序了,出現四個1位置相同的情況肯定是4!種,如果使用了相同的數就跳過,理論上是要計算43680*43680次,但是我也沒測試過有沒有超時,你能不能現把你寫的意思告訴我?
            re: 說題~ comiz 2007-11-11 19:01
            我參照的你的思想,用c#寫的
            private void solve()
            {
            int count=0,n=0;
            for(int i=0;i<43680;i+=24)
            for(int j=i+24;j<43680;j+=24)
            if((A[i].flag&A[j].flag)==0)
            for(int k=0;k<24;k++)
            for(int l=0;l<24;l++)
            if(A[i+k].result==A[j+l].result)
            No[A[i+k].flag|A[j+l].flag]++;

            for(count=0;count<two(16);count++)
            if(No[count]!=0&&No[(two(16)-1)^count]!=0)
            {
            n+=No[count]*No[(two(16)-1)^count];
            }
            Console.WriteLine("count:"+(n/2).ToString());

            }
            我剛剛學算法,可能是我沒有充分理解你寫的吧.另外我十分佩服你!
            re: 說題~ comiz 2007-11-11 00:29
            我看了很久你第一題的代碼,感覺你的SOLVE函數前面的比較部分是哪里錯了
            re: a problem of maze comiz 2007-11-04 19:35
            using System;
            using System.Collections;
            using System.ComponentModel;
            using System.Data;
            using System.Threading;

            namespace TroytownKeeper
            {

            public class TroytownKeeper
            {
            string [] maze;
            bool [,]used=new bool[100,100];
            int sum=0;
            public TroytownKeeper()
            {



            }

            public int LimeLiters(string [] maze)
            {
            this.maze=maze;
            for(int x=0;x<maze.GetLength(0);x++)
            {
            if(maze[x][0]=='.') dfs(x,0);
            if(maze[x][maze[0].Length-1]=='.') dfs(x,maze[0].Length-1);
            }
            for(int y=0;y<maze[0].Length-1;y++)
            {
            if(maze[0][y]=='.') dfs(0,y);
            if(maze[maze.GetLength(0)-1][y]=='.') dfs(maze.GetLength(0)-1,y);
            }

            for(int x=0;x<maze.GetLength(0);x++)
            for(int y=0;y<maze[0].Length;y++)
            if(maze[x][y]=='#')
            {
            //upside
            if(x==0)
            sum++;
            if(x<maze.Length-1&&used[x+1,y])
            sum++;
            //leftside
            if(y==0)
            sum++;
            if(y>0&&used[x,y-1])
            sum++;
            //underside
            if(x==maze.Length-1)
            sum++;
            if(x>0&&used[x-1,y])
            sum++;
            //rightside
            if(y==maze[0].Length-1)
            sum++;
            if(y<maze[0].Length-1&&used[x,y+1])
            sum++;
            }
            return sum;
            }

            static void Main(string[] args)
            {
            TroytownKeeper TK=new TroytownKeeper();
            string [] str={"##..#"
            ,"#.#.#"
            ,"#.#.#"
            ,"#####"};
            int count=TK.LimeLiters(str);
            Console.WriteLine(count.ToString());
            }


            void dfs(int x,int y)
            {
            used[x,y]=true;
            if(x<maze.GetLength(0)&&maze[x+1][y]=='.'&&!used[x+1,y]) dfs(x+1,y);
            if(y<maze[0].Length&&maze[x][y+1]=='.'&&!used[x,y+1]) dfs(x,y+1);
            if(x>0&&maze[x-1][y]=='.'&&!used[x-1,y]) dfs(x-1,y);
            if(y>0&&maze[x][y-1]=='.'&&!used[x,y-1]) dfs(x,y-1);
            }
            }
            }

            <2025年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            導航

            統計

            常用鏈接

            留言簿(1)

            隨筆檔案

            搜索

            最新評論

            閱讀排行榜

            評論排行榜

            伊人久久精品无码二区麻豆| 婷婷久久五月天| 久久99精品国产麻豆宅宅| 精品九九久久国内精品| 精品人妻伦一二三区久久| 国内精品伊人久久久久妇| 久久中文骚妇内射| 久久人人爽人人澡人人高潮AV| 亚洲日本va中文字幕久久| 国产精品久久久久久久午夜片| 久久精品国产亚洲av麻豆图片| 国产人久久人人人人爽| 亚洲国产一成久久精品国产成人综合 | 国产亚洲婷婷香蕉久久精品| 久久av免费天堂小草播放| 麻豆AV一区二区三区久久| 久久久久久国产精品免费免费| 久久国产欧美日韩精品| 欧美国产成人久久精品| 久久精品夜色噜噜亚洲A∨| 72种姿势欧美久久久久大黄蕉| 99久久精品免费看国产一区二区三区| 久久久久亚洲?V成人无码| 久久久久久久人妻无码中文字幕爆 | 精品视频久久久久| 2020久久精品国产免费| 精品国产青草久久久久福利| 久久中文精品无码中文字幕| 精品人妻伦九区久久AAA片69| 97久久精品人人澡人人爽| 久久精品草草草| 久久久国产精品网站| 婷婷五月深深久久精品| 婷婷久久五月天| 久久亚洲国产精品成人AV秋霞| 亚洲精品乱码久久久久久不卡| 久久久久国产精品麻豆AR影院 | 久久综合久久鬼色| 亚洲第一永久AV网站久久精品男人的天堂AV| 996久久国产精品线观看| 久久亚洲AV成人出白浆无码国产|