锘??xml version="1.0" encoding="utf-8" standalone="yes"?>无码精品久久一区二区三区,久久这里只有精品首页,国内精品伊人久久久久AV影院http://www.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://www.shnenglu.com/vontroy/archive/2010/07/29/121524.htmlVontroyVontroyWed, 28 Jul 2010 23:18:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/07/29/121524.htmlhttp://www.shnenglu.com/vontroy/comments/121524.htmlhttp://www.shnenglu.com/vontroy/archive/2010/07/29/121524.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/121524.htmlhttp://www.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://www.shnenglu.com/vontroy/archive/2010/07/29/121519.htmlVontroyVontroyWed, 28 Jul 2010 22:58:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/07/29/121519.htmlhttp://www.shnenglu.com/vontroy/comments/121519.htmlhttp://www.shnenglu.com/vontroy/archive/2010/07/29/121519.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/121519.htmlhttp://www.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 鍙戣〃璇勮
]]>
婷婷久久五月天| 欧美黑人又粗又大久久久| 大美女久久久久久j久久| 精品久久久久久国产三级| 精品久久久久久无码不卡| 久久综合国产乱子伦精品免费| 2022年国产精品久久久久 | 久久久国产精品亚洲一区| 情人伊人久久综合亚洲| 亚洲婷婷国产精品电影人久久| 久久精品无码一区二区无码| 精品久久久无码中文字幕| 亚洲va久久久噜噜噜久久| 国产农村妇女毛片精品久久 | 精品人妻久久久久久888| 久久久久国产| 久久99精品国产自在现线小黄鸭| 久久综合狠狠综合久久97色| 久久99国产精品久久久| 国产亚洲精久久久久久无码77777| 久久精品一区二区三区不卡| 国产69精品久久久久观看软件| 一级做a爰片久久毛片人呢| 99久久久精品| 久久婷婷国产综合精品| 无码国内精品久久人妻蜜桃| 亚洲乱码日产精品a级毛片久久 | 四虎国产精品免费久久久| 色88久久久久高潮综合影院| 中文字幕无码av激情不卡久久| 99久久精品国产一区二区三区| 日日噜噜夜夜狠狠久久丁香五月| 天天做夜夜做久久做狠狠| 久久久久久国产精品无码下载 | 久久久久女人精品毛片| 91麻豆国产精品91久久久| 久久人人爽人人爽AV片| 精品久久久久久无码中文野结衣| 久久精品国产精品亚洲精品| 99久久国产免费福利| 久久亚洲2019中文字幕|