NightmareTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8480Accepted Submission(s): 4069Problem D...
转载
2015-07-30 20:02:00
52阅读
2评论
【题目链接】 http://acm.hdu.edu.cn/showproblem.php?pid=3085 【算法】 双向BFS 【代码】
转载
2018-07-05 15:49:00
79阅读
2评论
题目地址:点击打开链接思路:感觉还是挺难的,主要是走过的路还可以再走,刚开始直接DFS和猜的没错,死循环了,没办法,总想验证一下想的对不?接着改,原来是要把每次走过的点记录下来,要是再次走过这个点时,距离爆炸的时间没有比原来的还短就不用走了,比原来爆炸的更快,没必要走,可以直接减枝,减了一下午没减出来,我也是服了,好那就BFS,超内存,就想走过的点没必要再走了吧,就把走过的
原创
2022-08-04 09:05:28
36阅读
1代表空地 0代表阻挡物 3代表出口 4代表补给站 问最短路径
因为可以重复走 为了防止超时 要用一个use数组 要是当前的时间比use数组的大 更新use数组的值 相当于剪枝
AC代码:
#include<stdio.h>
#include<queue>
#include<string.h>
using namespace std;
struct node{
...
原创
2021-07-09 14:52:29
124阅读
原题链接 考察:bfs 第一思路: 预处理鬼到达每个点的最短时间,再对男孩与女孩分别bfs...体感没错,不知道会不会MLE,但本蒟蒻连样例都没过.... 省事思路: 压根不用对鬼bfs.如果鬼能在k秒后达到某点,说明鬼的起点与终点的曼哈顿距离<=2*k.本蒟蒻完全没想到.... 接下来是对男女分别
转载
2021-04-22 21:33:00
60阅读
2评论
Nightmare
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12701 Accepted Submission(s):
6199
Problem Description
Ignatius had a nightmare la
原创
2021-08-30 16:37:49
30阅读
Nightmare
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12701 Accepted Submission(s):
6199
Problem Description
Ignatius had a nightmare l
原创
2021-08-31 10:14:01
17阅读
Problem Description
Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the
原创
2022-11-09 20:05:41
87阅读
非常标准的BFS 第一次写错了很多 1、到达4时设置为墙就好了 避免了死循环 2、不用开d数组 在结构体里面就行了 3、结构体初始化函数的写法: Node(int x=0,int y=0,int oil=0):x(x),y(y),oil(oil){} 4、bfs的FOR里面的判断条件可以写的很清晰!
转载
2019-01-21 14:05:00
45阅读
2评论
本篇文章仅用于技术交流学习和研究的目的,严禁使用文章中的技术用于非法目的和破坏,否则
原创
2022-06-22 07:03:03
136阅读
NightmareTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4504Accepted Submission(s): 2272Problem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get
转载
2012-10-28 18:34:00
55阅读
2评论
Nightmare Ⅱ昨天晚上,小狼(不想翻译名字了。。)做了一个噩梦,他梦到他和他的女朋
原创
2022-08-22 21:23:18
74阅读
题目传送门题意:一个人去救女朋友,两个人都在运动,还有鬼在"扩散",问最少几秒救到女朋友分析:开两个队列来表示两个人走过的路,一个人走到的地方另一个人已经vis了,那么就是相遇了,鬼就用曼哈顿距离判断.#include using namespace std;const int N = 8e2 + ...
转载
2015-11-24 21:32:00
90阅读
2评论
NightmareTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 655
原创
2022-03-11 15:50:14
30阅读
// Time 0ms, Memory 356K#include
#include
#include
using namespace std;
int n,m,p[9][9],sx,sy,dx[]={0,1,0,-1},dy[]={1,0,-1,0};
struct point
{ int x,y,time,step; point(int x=0,int y=0,int time=0,int step=0):x(x),y(y),time(time),step(step){}
};
int bfs()
{ point s(sx,sy,6,0),t; queueq;...
转载
2013-06-11 16:27:00
81阅读
2评论
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid
转载
2018-11-27 23:37:00
107阅读
2评论
http://acm.hdu.edu.cn/showproblem.php?pid=1072 Nightmare Time Limit: 2000/1000 MS (Java/Others)Memor
转载
2013-07-22 18:50:00
38阅读
2评论
[POJ1984]Navigation Nightmare 试题描述 Farmer John's pastoral neighborhood has N farms (2 <= N <= 40,000), usually numbered/labeled 1..N. A series of M (1
转载
2017-02-11 12:59:00
47阅读
2评论