• <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 閱讀(462) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:搜索
            色综合久久综合网观看| 欧洲成人午夜精品无码区久久| 国产精品欧美久久久天天影视| 日本久久久久久中文字幕| 久久久久久久久久久免费精品| 久久精品国产99久久久古代| 91精品国产综合久久婷婷| 日韩美女18网站久久精品| 99国产精品久久久久久久成人热| 久久精品不卡| 久久九九全国免费| 久久精品国产亚洲AV蜜臀色欲 | 成人国内精品久久久久一区| 久久精品嫩草影院| 亚洲中文字幕久久精品无码APP| 成人综合伊人五月婷久久| 久久精品一区二区三区AV| 久久国产视屏| 久久国产成人精品麻豆| 精品国际久久久久999波多野| 青青草国产97免久久费观看| 亚洲国产精品人久久| 国产精品99久久精品| 国产亚洲精品久久久久秋霞| 久久夜色精品国产www| 99久久精品这里只有精品| av无码久久久久不卡免费网站| 久久精品国产亚洲AV不卡| 色综合合久久天天给综看| 欧美无乱码久久久免费午夜一区二区三区中文字幕 | 久久99免费视频| 久久久久亚洲av成人网人人软件| 久久久久99精品成人片试看 | 一本色道久久88—综合亚洲精品| 四虎亚洲国产成人久久精品| 久久男人AV资源网站| 久久久99精品成人片中文字幕| 精品久久久久久国产牛牛app| 国内精品久久久久久久涩爱| 久久久网中文字幕| 久久这里有精品|