• <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)  編輯 收藏 引用 所屬分類: 題目分類:搜索
            国内精品人妻无码久久久影院| 久久水蜜桃亚洲av无码精品麻豆 | 精品无码久久久久久尤物| 久久久久亚洲AV无码观看| 久久精品国产亚洲精品2020| 99久久国产综合精品网成人影院| 国产精品免费久久久久影院 | 老司机午夜网站国内精品久久久久久久久 | 97久久天天综合色天天综合色hd| 久久精品国产清自在天天线| 久久香蕉超碰97国产精品| 国产精品免费久久| 国产精品一区二区久久不卡| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 精品久久久久一区二区三区| 久久久久久久97| 精品久久国产一区二区三区香蕉| 久久亚洲中文字幕精品一区| 久久播电影网| 精品久久久久久国产| 欧美大香线蕉线伊人久久| 久久精品无码一区二区三区免费| 浪潮AV色综合久久天堂| 久久无码高潮喷水| 香蕉久久影院| 亚洲国产成人乱码精品女人久久久不卡 | 精品久久久久久无码中文野结衣| 国产精品对白刺激久久久| 久久精品国产亚洲av麻豆图片 | 久久久久久无码Av成人影院| 久久无码中文字幕东京热| 伊人久久大香线蕉综合网站| 久久久久亚洲精品中文字幕| 办公室久久精品| 国产女人aaa级久久久级| 51久久夜色精品国产| 精品久久久久久久中文字幕 | 国产精品VIDEOSSEX久久发布| 亚洲狠狠久久综合一区77777| 久久精品这里热有精品| 久久精品成人欧美大片|