E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
hdu1026
hdu1026
题解
http://acm.hdu.edu.cn/showproblem.php?pid=1026【题意】就是求从(0,0)到(n-1,m-1)所需要的时间,中间有不能走的陷阱和要PK的怪兽血量;【题解】直接dfs肯定会超时,然后我又想到了自己曾经“研发”的倒水法(哈哈哈!)。但是那种“倒水法”只适用于最短路径的最快时间。所以我想到将怪兽的每一格血量,当作是一个单位时间流动(也许我讲的太复杂,其实并不难
cymxyym
·
2020-09-15 13:07
HDOJ
HDU1026
Ignatius and the Princess I 解题报告--bfs
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):9811AcceptedSubmission(s):2928SpecialJudgeProblemDescriptionThePrincesshasbeenabductedb
夕里子
·
2020-09-15 13:16
搜索
HDU
bfs
HDU1026
Ignatius and the Princess I
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):9533AcceptedSubmission(s):2829SpecialJudgeProblemDescriptionThePrincesshasbeenabductedb
weixin_33826609
·
2020-08-04 04:49
ACM-BFS之Ignatius and the Princess I ——
hdu1026
IgnatiusandthePrincessISpecialJudgeProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrin
ltree98
·
2020-08-03 19:37
ACM-搜索
漫漫刷题路
hdu1026
(BFS,打印路径)
题目链接:
hdu1026
思路:用BFS搜,用数组dir[i][j]记录该点是由哪一个方向上的点遍历过来的,v[i][j]记录是否在该点上遇到怪物。
jz-nice
·
2020-07-30 01:18
搜索
HDU1026
Ignatius and the Princess I【优先搜索】
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):20304AcceptedSubmission(s):6619SpecialJudgeProblemDescriptionThePrincesshasbeenabducted
海岛Blog
·
2020-07-30 00:33
#
ICPC-备用二
#
ICPC-HDU
#
ICPC-优先搜索
HDU1026
Ignatius and the Princess I(java)
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166’scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
路远兮
·
2020-07-30 00:05
ACM
HDU1026
小雅文给推荐了一个杭电上的题,跳过题目看样例就知道是个BFS走地图……看到样例输出当时我就想骂人。先给出题目。IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):11188AcceptedSubmission(s):3418S
superlong100
·
2020-07-30 00:54
ACM/ICPC
C语言
算法
杭电
HDU1026
:Ignatius and the Princess I(BFS)
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
键盘上的舞者
·
2020-07-29 20:24
搜索
HDU1026
——Ignatius and the Princess I (优先队列+bfs)
IgnatiusandthePrincessI点击发现宝藏TimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):17276AcceptedSubmission(s):5530SpecialJudgeProblemDescriptionThePrincesshasbeenab
curson_
·
2020-07-29 18:32
ACM-HDU
hdu1026
迷宫王子救公主 BFS+优先队列
//简单BFS,保存路径有点麻烦#include#include#includeusingnamespacestd;structnode{intx,y,step;friendbooloperator=n||y>=m)//排除不可能的情况,即出界return1;if(map[x][y]==-1)//说明是墙,不能走return1;return0;}intbfs(){inti;priority_que
popcjz
·
2020-07-29 17:41
搜索
HDU1026
Ignatius and the Princess I(优先队列加记录路径)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1026思路:此题与普通的迷宫题差异主要在以下两个方面:(1).存在monster。所以普通队列得到的答案不一定是整体的最优解。(2).需要输出路径。第一点:使用自定义优先级的优先队列即可解决。第二点:使用结构体(或二维数组)来记录路径。但为了避免被可以通过但明显不是最优解的状态将最优解的路径所覆盖掉,我
新熊君
·
2020-07-29 16:59
hdu1026
Ignatius and the Princess I --BFS & 记录路径 & 与DFS的比较
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1026一:题意一个n*m的矩阵代表一个迷宫,(0,0)是起点,(n-1)(m-1)是终点,每移动一步一秒。迷宫每点意义是:.该点可以走X该点不可以走n在该点停留n秒(其中1#include#include#include#includeusingnamespacestd;intn,m;intdir[4]
LaoJiu_
·
2020-07-29 15:33
【搜索】--DFS/BFS
hdu1026
/*分析:1次ac,0MS,哦耶~用的广搜,数据应该挺弱的,本来都想好要优化了,然后再试试弄到0MS,可是牟想到--,木优化也0MS了。所以,直接打表记录路径吧。2012-07-19*/#include"stdio.h"#include"string.h"#include"queue"usingnamespacestd;structnode{intx,y;intstep;friendboolope
Ice_Crazy
·
2020-07-29 15:50
搜索
HDU1026
Ignatius and the Princess I(BFS+优先队列)
HDU1026IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourpre
Sqwlly
·
2020-07-29 15:24
ACM
算法
HDU
ACM
ACM
HDU
BFS+打印路径
优先队列
hdu1026
Ignatius and the Princess I(BFS+优先队列)
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1026IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):13944AcceptedSubmission(s):4381Specia
weixin_30552635
·
2020-07-29 14:18
hdu1026
Ignatius and the Princess I(bfs+优先队列+记录路径)
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18858AcceptedSubmission(s):6093SpecialJudgeProblemDescriptionThePrincesshasbeenabducted
甄情
·
2020-07-29 14:59
【搜索】
Acm竞赛
hdu1026
(bfs+记录路径)
题意:给定一个迷宫n*m(1(1,0)2s:(1,0)->(1,1)3s:(1,1)->(2,1)4s:(2,1)->(2,2)5s:(2,2)->(2,3)6s:(2,3)->(1,3)7s:(1,3)->(1,4)8s:FIGHTAT(1,4)9s:FIGHTAT(1,4)10s:(1,4)->(1,5)11s:(1,5)->(2,5)12s:(2,5)->(3,5)13s:(3,5)->(4
sugar_coated
·
2020-07-11 08:32
HDU1026
Ignatius and the Princess I BFS
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):22883AcceptedSubmission(s):7378SpecialJudgeProblemDescriptionThePrincesshasbeenabducted
DouglasConnor
·
2019-01-26 00:28
BFS
HDU
HDU
BFS
bfs+优先队列,保存路径——
HDU1026
IgnatiusandthePrincessIThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weas
鸭脖yb
·
2018-08-03 08:58
BFS
HDU 1026 Ignatius and the Princess I (bfs + 优先队列 + 路径记录)
HDU1026
通过记录前驱来记录路径,不用担心所记录的路径不是用时最少的路径,因为优先队列每次出队的都是用时最少的元素,所以当不合适的元素出队时,正确的路径早已被标记完了。
Strokess
·
2016-04-01 19:00
HDU1026
(BFS求最短路径并记录)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1026一.题意:英雄去救公主,起点(0,0),终点(row-1,col-1),‘X'不能走,遇到数字停下来打怪,数字多少就要打多少秒,求最快到达时间。二.解题思路:看结构体怎么定义的就直接知道我怎么记录路径的,记得路径的数组要开大一些。三.AC代码:#include#include#include#in
H992109898
·
2016-03-11 09:14
搜索算法
HDU1026
(BFS求最短路径并记录)
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1026一.题意:英雄去救公主,起点(0,0),终点(row-1,col-1),‘X'不能走,遇到数字停下来打怪,数字多少就要打多少秒,求最快到达时间。二.解题思路:看结构体怎么定义的就直接知道我怎么记录路径的,记得路径的数组要开大一些。三.AC代码:#include #include #include
H992109898
·
2016-03-11 09:00
hdu1026
Ignatius and the Princess I (优先队列 BFS)
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
·
2015-12-09 11:25
优先队列
hdu1026
Ignatius and the Princess I
题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=98233#problem/H题目大意:模拟一个人走迷宫,遇到怪兽要和他决斗,决斗时间为那个格子的数字。输出(0,0)->(n-1,m-1)的最短路且showtheway。分析:题不难,不过写的时候太粗心了,第一次dfs没过,之后用bfs+记忆化搜索,有个细节写的时候没注意,改了好
codeTZ
·
2015-11-22 21:00
HDU
bfs
记忆化搜索
1026
HDU1026
(BFS)
题意:从起点到终点,输出路径长度,时间。 bfs+记录路径 View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<queue> 5 const int N = 105; 6 const int
·
2015-11-13 02:33
HDU
hdu1026
//BFS+优先队列(打印路径) #include<cstdio> #include<cstdlib> #include<cstring> #include<queue> using namespace std; const int ROW = 101; const int COL = 101; const int DIRS
·
2015-11-07 13:29
HDU
hdu1026
Ignatius and the Princess I (优先队列 BFS)
Problem Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth
·
2015-10-31 18:37
优先队列
hdu1026
Ignatius and the Princess I(BFS+优先队列)
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1026IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):13944 AcceptedSubmission(s):43
chaiwenjun000
·
2015-05-03 11:00
ACM
优先队列
STL
HDU
bfs
hdu1026
——Ignatius and the Princess I
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
Guard_Mine
·
2014-09-08 22:00
bfs
HDU1026
Ignatius and the Princess I 【BFS】+【路径记录】
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):11710 AcceptedSubmission(s):3661SpecialJudgeProblemDescriptionThePrincesshasbeen
u012846486
·
2014-07-22 14:00
hdu1026
HDU1026
Ignatius and the Princess I 优先队列宽搜+路径输出
K- IgnatiusandthePrincessITimeLimit:1000MS MemoryLimit:32768KB 64bitIOFormat:%I64d&%I64uSubmit StatusDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourpr
u014569598
·
2014-06-29 09:00
ACM-BFS之Ignatius and the Princess I ——
hdu1026
IgnatiusandthePrincessISpecialJudgeProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrin
lx417147512
·
2014-02-26 09:00
ACM
bfs
and
the
PRI
Ignatius
hdu1026
HDU1026
BFS&&优先队列&&路径保存
刚开始做BFS专题时遇到它,因为路径保存放弃了现在做,刚开始各种WA。。。。。后来加了个优先队列,就AC了。。额。。#include #include #include #include #include #include #include #include #include #include #include usingnamespacestd; #defineinf2147483647 #de
u012861385
·
2013-11-23 21:00
HDU1026
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):10225 AcceptedSubmission(s):3095SpecialJudgeProblemDescriptionThePrincesshasbeen
leolinsheng
·
2013-10-07 21:00
ACM
Ignatius and the Princess I(
hdu1026
,带权值的bfs)
/*http://acm.hdu.edu.cn/showproblem.php?pid=1026IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):9969 AcceptedSubmission(s):2989Speci
JHC23
·
2013-08-14 20:00
hdu1026
Ignatius and the Princess I BFS
http://acm.hdu.edu.cn/showproblem.php?pid=1026IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):9535 AcceptedSubmission(s):2830Spe
yew1eb
·
2013-07-21 14:00
HDU1026
Ignatius and the Princess I
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):9533 AcceptedSubmission(s):2829SpecialJ
lsh670660992
·
2013-07-21 10:00
HDU 1026 (BFS+记录路径)
BFS+路径记录:/* *problemID:
HDU1026
*AuthorID:fuqiang11 *TIME:2013-07-17 *Algorithm:BFS *Status:(Accept) *
i_fuqiang
·
2013-07-16 21:00
HDU1026
:Ignatius and the Princess I(BFS)
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
libin56842
·
2013-06-07 21:00
ACM
HDU
bfs
搜索
===================================[搜索入门]===================================搜索基础
HDU1026
:IgnatiusandthePrincessIHDU1072
l383137093
·
2013-05-18 19:00
搜索
HDU1026
:Ignatius and the Princess I
点击打开题目链接IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):8688 AcceptedSubmission(s):2590SpecialJudgeProblemDescriptionThePrincess
l383137093
·
2013-04-23 21:00
搜索
bfs
HDU1026
——Ignatius and the Princess I(BFS)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1026典型的广度优先搜索,其实这个我已经写了很多遍了,但是写这个代码的时候还是花了我一上午的时间,为什么呢,以为我写代码的时候把中间最优值更新的部分的map[nx][ny]敲成了map[x][y],血淋淋的教训啊,尼玛,很熟练的写完了,调试了很久都觉得没错了。唉,所以说还有要细心一点啊。这种输入错误,很
kay_zhyu
·
2013-03-29 14:00
搜索
bfs
HDU1026
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
mxway
·
2012-12-20 09:00
hdu1026
这题花了很长时间,代码还是有点乱~~#include #include #include #include usingnamespacestd; #defineINF10000000 charmap[105][105]; intd[105][105]; intvisit[105][105]; intxx[4]={1,-1,0,0}; intyy[4]={0,0,1,-1}; structnode
JustSteps
·
2012-11-15 22:00
hdu1026
http://acm.hdu.edu.cn/showproblem.php?pid=1026
一道打印路径的题目 :学习了第一次做这种题型#include #include #include #include usingnamespacestd; charmap[101][101]; intminTime[101][101]; introat[4][2]={0,1,1,0,0,-1,-1,0}; intn,m; inthead,last; structNode { intx; inty;
wahaha1_
·
2012-10-21 18:00
hdu1026
Ignatius and the Princess I BFS之打印路径 虐死我得一个题
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):6305 AcceptedSubmission(s):1882SpecialJudgeProblemDescriptionThePrincesshasbeena
hnust_xiehonghao
·
2012-07-20 21:00
struct
kill
input
each
output
Numbers
hdu 1026(Ignatius and the Princess I)
hdu1026
(IgnatiusandthePrincessI) 1 #include 2 #include 3 #include 4 #include 5 using namespace std
冰王子Leo与ACM一起的成长
·
2012-05-04 00:00
hdu1026
Ignatius and the Princess I(广度优先搜索)
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
tonghu2010
·
2011-04-27 07:00
kill
input
Path
each
output
Numbers
hdu 1026 广搜
hdu1026
广搜自己写的393MS用的是简单的广搜过的#include#includeusing namespace std;#define INF 999999int n,m;int dir[4][
【鈺仯爺】的 ACM博客
·
2010-08-17 10:00
上一页
1
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他