杭电1242--Rescue(BFS+优先队列)
来源:互联网 发布:数据采集卡原理设计 编辑:程序博客网 时间:2024/06/05 05:24
Angel's friends want to save Angel. Their task is: approach Angel.We assume that "approach Angel" is to get to the position whereAngel stays. When there's a guard in the grid, we must kill him (orher?) to move into the grid. We assume that we moving up, down,right, left takes us 1 unit time, and killing a guard takes 1 unittime, too. And we are strong enough to kill all the guards.
You have to calculate the minimal time to approach Angel. (We canmove only UP, DOWN, LEFT and RIGHT, to the neighbor grid withinbound, of course.)
Then N lines follows, every line has M characters. "." stands forroad, "a" stands for Angel, and "r" stands for each of Angel'sfriend.
Process to the end of the file.
# include<stdio.h>
# include<stdlib.h>
# include<string.h>
int num[210][210],n,m,x1,y1,mtime;//num[][]记录走到该点的最优时间
int dir[4][2]={-1,0,1,0,0,-1,0,1};
char map[210][210];
struct node{
};
struct node queue[500001];
void bfs(struct node start)
{
}
int main()
{
}
- 杭电1242-Rescue(bfs+优先队列||队列)
- 杭电1242--Rescue(BFS+优先队列)
- 【杭电oj】1242-Rescue(bfs,优先队列)
- 【搜索之BFS + 优先队列】杭电 hdu 1242 Rescue
- 杭电1242Rescue题(bfs+优先队列)
- 杭电ACM1242——Rescue~~BFS+优先队列
- hdu 1242Rescue(bfs+优先队列)
- hdu 1242 Rescue (优先队列+bfs)
- HDU 1242 Rescue(BFS +优先队列)
- 1242Rescue (优先队列BFS)
- HDU 1242 Rescue(BFS,优先队列)
- hdu 1242 Rescue(BFS优先队列)
- HDU 1242 Rescue(优先队列+bfs)
- hdu 1242 Rescue(BFS+优先队列)
- HDU 1242 Rescue(BFS+优先队列)
- hdoj 1242 Rescue (bfs+优先队列)
- hdu 1242 Rescue (BFS+优先队列)
- HDU 1242 Rescue (BFS+优先队列)
- 杭电1753--大明A+B
- poj1181--变形课(BFS)
- 杭电1198--Farm Irrigation(BFS外…
- 杭电1372--Knight Moves(BFS)
- poj1321--棋盘问题(DFS)
- 杭电1242--Rescue(BFS+优先队列)
- 黑马程序员-day05-面向对象(封装 Encapsulation)
- 杭电1159——Common Subsequence
- 杭电1087--Super Jumping! Jumping…
- iOS中Block介绍(一)基础
- 杭电1059--Dividing(多重背包一)
- 杭电2602--Bone Collector(01背包…
- 杭电1171--Big Event in HDU(多重…
- poj1315--Don't Get Rooked(DPS)