Problem Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into fe... ...
分类:
其他好文 时间:
2017-01-18 15:03:55
阅读次数:
289
#include <stdio.h> #include <string.h> #include <queue> using namespace std; struct node { int x,y,step; friend bool operator<(node n1,node n2) { retu ...
分类:
其他好文 时间:
2017-01-13 22:35:30
阅读次数:
236
问题链接:HDU1026 Ignatius and the Princess I。
题意简述:从矩阵的左上角走到右下角所需的最短时间,并且要求输出走的过程。矩阵中"."是可以走的,"X"是墙,n(数字1-9)是怪兽,需要战斗数字所示的时间。对于每个测试实例,先输入n和m,分别表示行数和列数,然后输入矩阵。
问题分析:显然求最短路径问题用BFS,另外由于有怪兽,所以搜索过程需要使用优先队列。...
分类:
其他好文 时间:
2016-08-17 06:49:20
阅读次数:
179
Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16713 Accepted Submis ...
分类:
其他好文 时间:
2016-07-15 19:34:32
阅读次数:
182
Ignatius and the Princess ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14577Accepted Submissio...
分类:
其他好文 时间:
2015-08-09 13:58:16
阅读次数:
107
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1026
Ignatius and the Princess I
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 13944 ...
分类:
其他好文 时间:
2015-05-03 13:27:20
阅读次数:
143
Ignatius and the Princess ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13911Accepted Submissi...
分类:
其他好文 时间:
2015-04-30 14:11:22
阅读次数:
171
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. To make the problem simply, we assume the labyrinth is a...
分类:
其他好文 时间:
2015-03-04 11:12:13
阅读次数:
201
广搜,用到优先队列,跟hdu1026差不多。但须注意几个问题:1、可以往回走,因为可以重设时间,有时需要拐弯去“加油”,但可重设时间的结点不能在让它有机会被重走,不然就进入死循环了。2、队列每次弹出的都是用时最少的,需要自定义排序#include #include using namespace s...
分类:
其他好文 时间:
2014-09-21 22:41:31
阅读次数:
356
Ignatius and the Princess I
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 11710 Accepted Submission(s): 3661
Special Judge
Problem...
分类:
其他好文 时间:
2014-07-22 18:00:03
阅读次数:
283