HDU 3533 Escape BFS搜索】的更多相关文章

题意:懒得说了 分析:开个no[100][100][1000]的bool类型的数组就行了,没啥可说的 #include <iostream> #include <cstdio> #include <vector> #include <cstring> #include <algorithm> #include <string> #include <cmath> #include <queue> #include…
要从0,0 点 跑到m,n点  路上会有k个堡垒发射子弹.有子弹的地方不能走,子弹打到别的堡垒就会消失,或者一直飞出边界(人不能经过堡垒 能够上下左右或者站着不动 每步都须要消耗能量  一共同拥有eng个能量 先预处理出地图 用三维数组表示mp[x][y][time] time表示该时间的地图上储存不能走的点 然后就是普通BFS #include <stdio.h> #include <string.h> #include <stdlib.h> #include <…
http://acm.hdu.edu.cn/showproblem.php?pid=3533 一道普通的bfs,但是由于代码实现出了bug还是拖了很久甚至对拍了 需要注意的是: 1.人不能经过炮台 2.能量耗尽时如果进入终点且终点没有炮弹也可以 3.炮台会遮挡住别的炮弹 前两点认为读题时不能确定 #include <cstdio> #include <cstring> #include <algorithm> #include <queue> using n…
Escape Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 541    Accepted Submission(s): 141 Problem Description The students of the HEU are maneuvering for their military training. The red army…
Escape Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 598    Accepted Submission(s): 153 Problem Description The students of the HEU are maneuvering for their military training.The red army a…
HDU 3533 Escape(大逃亡) /K (Java/Others)   Problem Description - 题目描述 The students of the HEU are maneuvering for their military training. The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red army, so…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3533 题目大意:给你一张n* m的地图,人在起点在(0,0)要到达终点(n,m)有k(k<=100)座炮台,每座炮台都有各自的发射方向.发射周期和发射速度,每隔一段时间会发射一定速度的炮弹,人每秒可以选择停在原地或者往上下左右走,问是否能在时间d之内安全到达终点.如果可以,请输出最短时间. 解题思路:BFS+预处理,分为以下几点: ①预处理,用step[x][y][t]记录(x,y)在时间t是否被炮…
http://acm.hdu.edu.cn/showproblem.php?pid=1495 题目就不说了, 说说思路! 倒可乐 无非有6种情况: 1. S 向 M 倒 2. S 向 N 倒 3. N 向 M 倒 4. N 向 S 倒 5. M 向 S 倒 6. M 向 N 倒 根据上述的六种情况来进行模拟, 每次模拟的结果都放进队列里面. 注意: 还要用到标记数组,防止数据重复进入队列导致爆栈. #include<stdio.h> #include<stdlib.h> #incl…
题意:有个为三个杯子(杯子没有刻度),体积为s,n,m,s=m+n, 刚开始只有体积为s的杯子装满可乐,可以互相倒,问你最少的次数使可乐均分,如果没有结果,输出-1; 分析:直接互相倒就完了,BFS模拟 注:写的很丑 #include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cmath> #include <set> #…
Asteroids! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3159    Accepted Submission(s): 2106 Problem Description You're in space.You want to get home.There are asteroids.You don't want to hit…