摘要:
该题与HDU 1728 逃离迷宫是一样的解题思路http://acm.hdu.edu.cn/showproblem.php?pid=1728;这里我采取的方法还是一直走到底,如果没有路了就代表一定要转完了。#include<stdio.h>#include<stdlib.h>#include<string.h>struct T{ int x,y,turn;}q[1000024];int map[1024][1024],n,m,k;int d[4][2]={ 0,1,1,0,0,-1,-1,0 };int hash[1024][1024];int inline 阅读全文
摘要:
该题是一道典型的搜索题,#include<stdio.h>#include<stdlib.h>#include<string.h>struct Node{ int x, y; int time; int flag;}q[100024];int d[4][2]={ 0,1,1,0,0,-1,-1,0 };int N,M;char map[2][13][13];void getxy( int &X,int &Y,int &K ){ for( int k=0;k<2;k++ ) for( int i=1;i<=N;i++ ) f 阅读全文