• <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 閱讀(455) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 題目分類:搜索
            国产午夜电影久久| 办公室久久精品| 久久免费国产精品一区二区| 精品久久久久中文字| 久久亚洲AV成人无码| 美女写真久久影院| 久久人人爽人人人人片av| 2020最新久久久视精品爱 | 久久99国产精品99久久| 久久毛片免费看一区二区三区| 久久青青草原精品国产| 色偷偷88欧美精品久久久| 久久91精品国产91久久户| 久久WWW免费人成一看片| 国产三级观看久久| 国产成人综合久久综合| 久久久久久久女国产乱让韩| 国产成人久久精品二区三区| 久久精品国产亚洲AV无码麻豆 | 国产精品乱码久久久久久软件| 久久精品国产精品国产精品污| 久久精品中文字幕一区| 人妻丰满?V无码久久不卡| 久久精品国产久精国产| 精品无码久久久久久午夜| 精品熟女少妇AV免费久久| 麻豆久久久9性大片| 久久久精品视频免费观看 | 久久人人爽人人爽人人av东京热| 精品久久久久中文字| 精品人妻伦九区久久AAA片69| 国产欧美久久一区二区| 久久99国产综合精品| 国内精品久久久久久久97牛牛| 久久影院综合精品| 青草国产精品久久久久久| 久久久久久久久无码精品亚洲日韩| 亚洲综合日韩久久成人AV| 亚洲AV无码久久精品蜜桃| 日本人妻丰满熟妇久久久久久| 日韩精品久久无码中文字幕|