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

            以下是我的代碼:
            /*
             * Author:  lee1r
             * Created Time:  2011/8/6 9:35:45
             * File Name: poj1321.cpp
             
            */
            #include
            <iostream>
            #include
            <sstream>
            #include
            <fstream>
            #include
            <vector>
            #include
            <list>
            #include
            <deque>
            #include
            <queue>
            #include
            <stack>
            #include
            <map>
            #include
            <set>
            #include
            <bitset>
            #include
            <algorithm>
            #include
            <cstdio>
            #include
            <cstdlib>
            #include
            <cstring>
            #include
            <cctype>
            #include
            <cmath>
            #include
            <ctime>
            #define L(x) ((x)<<1)
            #define R(x) (((x)<<1)+1)
            #define Half(x) ((x)>>1)
            #define lowbit(x) ((x)&(-(x)))
            using namespace std;
            const int kInf(0x7f7f7f7f);
            const double kEps(1e-8);
            typedef 
            long long int64;
            typedef unsigned 
            long long uint64;

            const int kMaxn(10);

            int n,k;
            int64 ans;
            bool g[kMaxn][kMaxn],row[kMaxn],col[kMaxn];

            void dfs(int depth,int now)
            {
                
            if(now==k)
                {
                    ans
            ++;
                    
            return;
                }
                
            if(depth>n)
                    
            return;
                dfs(depth
            +1,now);
                
            for(int i=1;i<=n;i++)
                    
            if(!row[i] && !col[i] && g[depth][i])
                    {
                        row[i]
            =col[i]=true;
                        dfs(depth
            +1,now+1);
                        row[i]
            =col[i]=false;
                    }
            }

            int main()
            {
                
            //freopen("data.in","r",stdin);
                
                
            while(scanf("%d%d",&n,&k)==2 && (n!=-1 || k!=-1))
                {
                    
            for(int i=1;i<=n;i++)
                    {
                        getchar();
                        
            for(int j=1;j<=n;j++)
                        {
                            
            char ch;
                            scanf(
            "%c",&ch);
                            
            if(ch=='#')
                                g[i][j]
            =true;
                            
            else
                                g[i][j]
            =false;
                        }
                    }
                    
                    ans
            =0;
                    memset(row,
            false,sizeof(row));
                    memset(col,
            false,sizeof(col));
                    dfs(
            1,0);
                    
                    cout
            <<ans<<endl;
                }
                
                
            return 0;
            }
            posted on 2011-08-06 09:45 lee1r 閱讀(463) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:搜索
            人人狠狠综合久久亚洲婷婷| 青草久久久国产线免观| 亚洲中文字幕无码久久精品1 | 亚洲综合久久综合激情久久| 国产免费福利体检区久久| 一本久道久久综合狠狠躁AV | 国内精品伊人久久久久av一坑 | 99久久国产热无码精品免费| 国产一区二区精品久久| 亚洲精品无码久久久久AV麻豆| 欧美亚洲色综久久精品国产| 国产 亚洲 欧美 另类 久久| 人妻精品久久久久中文字幕| 97r久久精品国产99国产精| 久久综合成人网| 中文精品99久久国产| 国产精品无码久久综合 | 91亚洲国产成人久久精品| 亚洲国产精品成人久久蜜臀| 久久精品国产亚洲AV高清热| 久久亚洲AV无码西西人体| 久久亚洲精品成人av无码网站| 精品久久久久久国产三级| 成人资源影音先锋久久资源网| 久久精品18| 久久水蜜桃亚洲av无码精品麻豆| 国产精品久久久99| 欧美精品一本久久男人的天堂| 久久国产色av免费看| 性做久久久久久免费观看| 激情五月综合综合久久69| 久久精品一区二区| 久久99精品国产| 秋霞久久国产精品电影院| 99精品国产在热久久无毒不卡| 狠狠色婷婷久久综合频道日韩| 色老头网站久久网| 亚洲色婷婷综合久久| 久久久精品人妻一区二区三区蜜桃| 亚洲第一永久AV网站久久精品男人的天堂AV | 国产三级久久久精品麻豆三级|