poj 3669 Meteor Shower(bfs)】的更多相关文章

Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroy…
Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroy…
POJ 3669 Meteor Shower(流星雨) Time Limit: 1000MS    Memory Limit: 65536K Description 题目描述 Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her sa…
Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroy…
题目链接:http://poj.org/problem?id=3669 很基础的一道bfs的题,然而,我却mle了好多次,并且第二天才发现错在了哪里_(:з)∠)_ 写bfs或者dfs一定要记得对走过的地点进行记录,这题我本以为没必要记录了,结果就一直Memory Limit Exceeded #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #incl…
-->Meteor Shower Descriptions: Bessie听说有场史无前例的流星雨即将来临:有谶言:陨星将落,徒留灰烬.为保生机,她誓将找寻安全之所(永避星坠之地).目前她正在平面坐标系的原点放牧,打算在群星断其生路前转移至安全地点. 此次共有M (1 ≤ M ≤ 50,000)颗流星来袭,流星i将在时间点Ti (0 ≤ Ti  ≤ 1,000) 袭击点 (Xi, Yi) (0 ≤ Xi ≤ 300; 0 ≤ Yi ≤ 300).每颗流星都将摧毁落点及其相邻四点的区域. Bess…
POJ 3669 去看流星雨,不料流星掉下来会砸毁上下左右中五个点.每个流星掉下的位置和时间都不同,求能否活命,如果能活命,最短的逃跑时间是多少? 思路:对流星雨排序,然后将地图的每个点的值设为该点最早被炸毁的时间 #include <iostream> #include <algorithm> #include <queue> #include <cstring> using namespace std; #define INDEX_MAX 512 int…
题意:给定 n 个炸弹的坐标和爆炸时间,问你能不能逃出去.如果能输出最短时间. 析:其实这个题并不难,只是当时没读懂,后来读懂后,很容易就AC了. 主要思路是这样的,先标记所有的炸弹的位置,和时间,在数组中标记就好,只要赋值给它的爆炸时间就好,注意如果有多个,要赋值最小的那个, 然后用BFS走就行了. 代码如下: #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #…
Meteor Shower Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 31358   Accepted: 8064 Description Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they h…
                                                                                                  Meteor Shower Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16339   Accepted: 4293 Description Bessie hears that an extraordinary meteor…