锘??xml version="1.0" encoding="utf-8" standalone="yes"?>无码精品久久一区二区三区,久久这里只有精品首页,国内精品伊人久久久久AV影院http://m.shnenglu.com/vontroy/category/14347.htmlzh-cnFri, 18 Jan 2013 07:34:30 GMTFri, 18 Jan 2013 07:34:30 GMT60POJ 2488 A Knight's Journey ----- DFShttp://m.shnenglu.com/vontroy/archive/2010/07/29/121524.htmlVontroyVontroyWed, 28 Jul 2010 23:18:00 GMThttp://m.shnenglu.com/vontroy/archive/2010/07/29/121524.htmlhttp://m.shnenglu.com/vontroy/comments/121524.htmlhttp://m.shnenglu.com/vontroy/archive/2010/07/29/121524.html#Feedback0http://m.shnenglu.com/vontroy/comments/commentRss/121524.htmlhttp://m.shnenglu.com/vontroy/services/trackbacks/121524.html#include <stdio.h>
#include 
<string.h>

const int maxn = 50;

int b[8]={-2-2-1-11122},a[8]={-11-22-22-11};
bool check[maxn][maxn], flag;
int ansx[maxn], ansy[maxn];
int row, col;

void dfs(int x, int y, int sum)
{
    
if(sum == col * row)
    {
        
for(int i=1; i<=sum; i++)
        printf(
"%c%d", ansy[i]+'A'-1, ansx[i]);
        printf(
"\n");
        flag
=1;
        
return;
    }
    
for(int i=0; i<8 && !flag; i++)
    {
        
if(!flag && !check[x+a[i]][y+b[i]] && x+a[i]>0 && x+a[i]<=row && y+b[i]>0 && y+b[i]<=col)
        {
            ansx[sum
+1= x+a[i];
            ansy[sum
+1= y+b[i];
            check[x
+a[i]][y+b[i]] = 1;
            dfs(x
+a[i], y+b[i], sum+1);
            check[x
+a[i]][y+b[i]] = 0;
        }
    }
}

int main()
{
    
int n;
    
int cas;
    
while(~scanf("%d",&n))
    {
        cas
=1;
        
while(n--)
        {
            flag 
= 0;
            memset(check,
0,sizeof(check));
            printf(
"Scenario #%d:\n",cas++);
            scanf(
"%d%d"&row, &col);
            check[
1][1]=1;
            ansx[
1= ansy[1= 1;
            dfs(
111);
            
if(!flag) printf("impossible\n");
            printf(
"\n");
        }
    }
    
return 0;
}


Vontroy 2010-07-29 07:18 鍙戣〃璇勮
]]>
HDU 1010 Tempter of the Bonehttp://m.shnenglu.com/vontroy/archive/2010/07/29/121519.htmlVontroyVontroyWed, 28 Jul 2010 22:58:00 GMThttp://m.shnenglu.com/vontroy/archive/2010/07/29/121519.htmlhttp://m.shnenglu.com/vontroy/comments/121519.htmlhttp://m.shnenglu.com/vontroy/archive/2010/07/29/121519.html#Feedback0http://m.shnenglu.com/vontroy/comments/commentRss/121519.htmlhttp://m.shnenglu.com/vontroy/services/trackbacks/121519.html#include <iostream>
#include 
<cstdio>
#include 
<cmath>

const int maxn = 10;

using namespace std;

bool escape;

char map[maxn][maxn];

int dir[4][2= {{-1,0}, {1,0}, {0,-1}, {0,1}};
int n, m, t;
int si, sj, di, dj;

void dfs( int x, int y, int cnt )
{
    
if( escape ) return;

    
if( x == di && y == dj && cnt == t )
    {
        escape 
= 1;
        
return;
    }

    
int temp = t - cnt - ( fabs(di - x) + fabs(dj - y ) );

    
if( temp < 0 || temp % 2 != 0 )     return;//濂囧伓鍓灊

    
if( x <= 0 || y <= 0 || x > n || y > m )    return;

    
forint i = 0; i < 4; i++ )
    {
        
if( map[x+dir[i][0]][y+dir[i][1]] != 'X')
        {
            map[x
+dir[i][0]][y+dir[i][1]] = 'X';
            dfs(x
+dir[i][0], y+dir[i][1], cnt+1);
            map[x
+dir[i][0]][y+dir[i][1]] = '.';
        }
    }

}

int main()
{
    
while( cin >> n >> m >> t, m || n || t )
    {
        
int wall = 0;
        escape 
= 0;
        
for ( int i = 1; i <= n; i++ )
            
for ( int j = 1; j <= m; j++ )
            {
                cin 
>> map[i][j];

                
if( map[i][j] == 'D')
                {
                    di 
= i;
                    dj 
= j;
                }

                
else if ( map[i][j] == 'S' )
                {
                    si 
= i;
                    sj 
= j;
                }

                
else if ( map[i][j] == 'X' )
                    wall 
++ ;
            }

        
if( m * n - wall <= t )
        {
            printf(
"NO\n");
            
continue;
        }
        
else
        {
            map[si][sj] 
= 'X';
            dfs( si, sj, 
0 );
            printf(
"%s\n", escape ? "YES" : "NO" );
        }
    }
    
return 0;
}


Vontroy 2010-07-29 06:58 鍙戣〃璇勮
]]>
精品久久国产一区二区三区香蕉| 久久国产精品99精品国产987| 久久青青草原国产精品免费 | 精品国产乱码久久久久久1区2区| 伊人色综合九久久天天蜜桃| 久久精品国产99久久久古代| 91麻豆国产精品91久久久| 性高湖久久久久久久久| 7国产欧美日韩综合天堂中文久久久久| 91亚洲国产成人久久精品网址 | 精品国产乱码久久久久久人妻| 少妇内射兰兰久久| 久久播电影网| 日本人妻丰满熟妇久久久久久| 久久国产午夜精品一区二区三区| 久久久久久国产精品美女| 99久久精品久久久久久清纯| 久久精品国产99国产精品亚洲| 99久久人人爽亚洲精品美女| 精品久久久无码人妻中文字幕| 伊人色综合久久天天| 久久久久亚洲精品天堂| 热久久视久久精品18| 品成人欧美大片久久国产欧美| 久久久一本精品99久久精品66| 久久涩综合| 久久最新精品国产| 国产精品99精品久久免费| 久久国产劲爆AV内射—百度| 三级片免费观看久久| 久久久久亚洲AV无码专区网站| 91精品国产高清久久久久久91| 精品久久人妻av中文字幕| 无码人妻久久一区二区三区| 久久综合久久伊人| 久久综合成人网| 久久综合久久伊人| 伊人久久大香线蕉无码麻豆| 合区精品久久久中文字幕一区| 亚洲国产成人久久综合碰| 一97日本道伊人久久综合影院|