题目 题目 分析 双向bfs,对着书打的,我还调了好久. 代码 #include<cstdio> #include<cstring> #include<cctype> #include<queue> using namespace std; const int maxs=20,maxn=150; const int dx[]={1,-1,0,0,0},dy[]={0,0,1,-1,0}; int s[3],t[3]; int deg[maxn…
Problem UVA1601-The Morning after Halloween Accept: 289 Submit: 3136 Time Limit: 12000 mSec Problem Description Input Output For each dataset in the input, one line containing the smallest number of steps to restore ghosts into the positions where…
Fire! Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze. Given Joe’s location in the maze and which squares of the maze are on fire…