• <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 閱讀(343) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:搜索
            久久精品国产一区二区三区日韩| 一级a性色生活片久久无| 亚洲欧美国产精品专区久久| 久久精品国产精品亚洲下载| 久久亚洲AV无码精品色午夜 | 日本欧美国产精品第一页久久| 欧美久久一级内射wwwwww.| 伊人久久成人成综合网222| 久久久久人妻精品一区二区三区| 91精品国产色综久久| 久久精品国产99国产精品导航| 久久国产精品久久精品国产| 色综合久久88色综合天天 | 久久久久亚洲精品天堂| 亚洲日本va午夜中文字幕久久 | 久久久久AV综合网成人| 久久精品国产亚洲7777| 99久久无码一区人妻a黑| 狠狠综合久久AV一区二区三区| 久久久精品视频免费观看| 欧美亚洲色综久久精品国产| 久久人人爽人人爽人人av东京热| 亚洲国产成人久久精品动漫| 久久香蕉超碰97国产精品| 欧洲国产伦久久久久久久| 2020最新久久久视精品爱| 精品蜜臀久久久久99网站| 亚洲精品美女久久777777| 久久综合综合久久综合| 久久无码AV一区二区三区| 色天使久久综合网天天| 99久久亚洲综合精品网站| 久久精品国产精品青草app| 久久久噜噜噜www成人网| 久久精品国产亚洲AV蜜臀色欲 | 中文无码久久精品| 国产精品久久久久免费a∨| 中文字幕精品久久| 久久久久久久精品成人热色戒| 欧美性大战久久久久久| 欧美久久久久久精选9999|