搜索
文章平均质量分 86
lele_pipi
生命不息,奋斗不止!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Knight Moves--广度优先搜索
Knight Moves Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given原创 2014-07-17 11:37:27 · 503 阅读 · 0 评论 -
hdu-1429-胜利大逃亡(续)-bfs+状态压缩
胜利大逃亡(续) Problem Description Ignatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)…… 这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。Ignatius每分钟只能从一个坐标走到相原创 2015-06-01 12:14:01 · 1304 阅读 · 0 评论 -
hdu1195-Open the Lock-双向&&单向bfs
Open the Lock Problem Description Now an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9. Each time, you can add原创 2015-05-29 16:37:18 · 379 阅读 · 0 评论 -
hdu-1142-A Walk Through the Forest-最短路+记忆化搜索
A Walk Through the Forest Problem Description Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to原创 2015-05-26 16:16:58 · 406 阅读 · 0 评论 -
广搜+优先队列+递归+hdu1026
Ignatius and the Princess I 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. T原创 2014-12-28 13:47:41 · 617 阅读 · 0 评论 -
广搜-nyoj-隐式图的搜索-三个水杯
三个水杯 描述给出三个水杯,大小不一,并且只有最大的水杯的水是装满的,其余两个为空杯子。三个水杯之间相互倒水,并且水杯没有标识,只能根据给出的水杯体积来计算。现在要求你写出一个程序,使其输出使初始状态到达目标状态的最少次数。 输入第一行一个整数N(0 接下来每组测试数据有两行,第一行给出三个整数V1 V2 V3 (V1>V2>V3 V10)表示三个水杯的体积。原创 2014-12-28 17:26:44 · 590 阅读 · 0 评论 -
bfs-hdu-1072-Nightmare
#include #include #include #include using namespace std; int N,M,mt; int map[10][10]; struct node { int x,y; int step; int cnt; }; queue q; int dir[4][2]={{-1,0},{0,1},{1,0},{0,-1}}; void原创 2015-01-14 19:53:06 · 409 阅读 · 0 评论 -
nyoj-1100-广搜+优先队列-WAJUEJI which home strong!
WAJUEJI which home strong! 描述 在一个山沟里,姐弟俩同时考上了大学。但由于家里拮据,所以这并不是什么好消息。父亲对孩子说:我就是砸锅卖铁也要把你们姐俩供出来。 当时的姐姐已经决定放弃上学的机会。 没想到第二天天还没亮,弟弟就偷偷带著几件破衣服和几个乾巴馒头走了,在姐姐枕边留下一个纸条: 姐,你别愁了,考上大学不容易,我出去打工供你。弟原创 2014-11-05 17:13:14 · 1090 阅读 · 0 评论 -
Catch That Cow-广度优先搜索-POJ3278
Catch That Cow Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the原创 2014-11-04 18:53:28 · 405 阅读 · 0 评论 -
Bicoloring-广搜
Bicoloring In 1976 the ``Four Color Map Theorem" was proven with the assistance of a computer. This theorem states that every map can be colored using only four colors, in such a way tha原创 2014-07-17 17:22:57 · 465 阅读 · 0 评论 -
hdu-1078-FatMouse and Cheese-记忆化搜索
FatMouse and Cheese Problem Description FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p <原创 2015-05-25 21:24:26 · 341 阅读 · 0 评论
分享