• <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>
            心如止水
            Je n'ai pas le temps
            posts - 400,comments - 130,trackbacks - 0
            #include<cstdio>
            using namespace std;
            const int score[10][10]={{0,0,0,0,0,0,0,0,0,0},
                                     {
            0,6,6,6,6,6,6,6,6,6},
                                     {
            0,6,7,7,7,7,7,7,7,6},
                                     {
            0,6,7,8,8,8,8,8,7,6},
                                     {
            0,6,7,8,9,9,9,8,7,6},
                                     {
            0,6,7,8,9,10,9,8,7,6},
                                     {
            0,6,7,8,9,9,9,8,7,6},
                                     {
            0,6,7,8,8,8,8,8,7,6},
                                     {
            0,6,7,7,7,7,7,7,7,6},
                                     {
            0,6,6,6,6,6,6,6,6,6}};

            int r[10][10],ans(-1),tot(0);
            bool squ[4][4][10],row[10][10],col[10][10];

            void f(int i,int &x,int &y)
            {
                x
            =i/9+1;
                y
            =i%9;
                
            if(i%9==0)
                {
                    x
            --;
                    y
            =9;
                }
            }
            void g(int x,int y,int &xx,int &yy)
            {
                xx
            =x/3;
                
            if(x%3)
                    xx
            ++;
                yy
            =y/3;
                
            if(y%3)
                    yy
            ++;
            }

            void dfs(const int &depth,const int &now)
            {
                tot
            ++;
                
            if(tot>=13000000)
                    
            return;

                
            if(depth<=0)
                {
                    
            if(ans<now)
                        ans
            =now;
                    
            return;
                }

                
            int x,y,xx,yy;
                f(depth,x,y);
                g(x,y,xx,yy);
                
            if(r[x][y])
                    dfs(depth
            -1,now+r[x][y]*score[x][y]);
                
            else
                {
                    
            for(int i=1;i<=9;i++)
                        
            if(!squ[xx][yy][i] && !row[x][i] && !col[y][i])
                        {
                            squ[xx][yy][i]
            =row[x][i]=col[y][i]=true;
                            dfs(depth
            -1,now+i*score[x][y]);
                            squ[xx][yy][i]
            =row[x][i]=col[y][i]=false;
                        }
                }
            }

            int main()
            {
                
            //*
                freopen("data.in","r",stdin);
                freopen(
            "data.out","w",stdout);
                
            //*/

                
            for(int i=1;i<=9;i++)
                    
            for(int j=1;j<=9;j++)
                    {
                        scanf(
            "%d",&r[i][j]);
                        
            int xx,yy;
                        g(i,j,xx,yy);
                        squ[xx][yy][r[i][j]]
            =row[i][r[i][j]]=col[j][r[i][j]]=true;
                    }

                dfs(
            81,0);
                printf(
            "%d\n",ans);

                
            return 0;
            }
            posted on 2011-07-20 20:02 lee1r 閱讀(354) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:搜索
            久久久噜噜噜久久| 少妇久久久久久被弄高潮| 久久se精品一区二区影院 | 精品综合久久久久久888蜜芽| 国产精品久久久久久久app| 精品久久久久久久久免费影院| 久久天天躁狠狠躁夜夜96流白浆| 国产精品亚洲美女久久久| 无码专区久久综合久中文字幕 | 国产精品禁18久久久夂久| 色婷婷狠狠久久综合五月| AV无码久久久久不卡网站下载| 久久久久一本毛久久久| 久久久精品人妻一区二区三区蜜桃| 久久综合九色综合欧美就去吻 | 久久91精品国产91| 久久久久无码精品国产app| 久久99亚洲网美利坚合众国| 久久精品国产亚洲AV影院| 亚洲欧洲久久av| 久久综合色区| 久久精品国产色蜜蜜麻豆| 久久精品国产精品国产精品污| 久久精品国产99国产精品导航| 婷婷久久综合| 无码乱码观看精品久久| 久久亚洲电影| 欧美性猛交xxxx免费看久久久| 久久高清一级毛片| 久久久久国产一区二区 | 久久久女人与动物群交毛片| 亚洲午夜福利精品久久| 思思久久99热只有频精品66| 理论片午午伦夜理片久久 | 久久国产精品无码一区二区三区| 亚洲AV无码久久精品成人| 亚洲AV日韩AV天堂久久| 婷婷久久久亚洲欧洲日产国码AV| 亚洲色欲久久久综合网| 久久久久亚洲AV成人网人人网站| 日本五月天婷久久网站|