![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
文章平均质量分 86
A_Happyer
这个作者很懒,什么都没留下…
展开
-
HDU1043:Eight HDU3567:Eight II(康拓展开+bfs搜索)
HDU1043:Eight这个题还算好过,用我刚整理的康拓展开的模板直接就ok的,需要注意的是对于这种终态唯一的题目,一般用终态来反搜初态,就是一边bfs记录下所有答案,如此如此,看下AC程序的主函数就能理解的。代码:#include#include#include#include#include#include#include#include#include#def原创 2015-03-07 00:46:28 · 876 阅读 · 0 评论 -
POJ 5025 Saving Tang Monk(状压搜索)
http://acm.hdu.edu.cn/showproblem.php?pid=5025搜索题:注意蛇的状态(第一次路过要杀掉蛇花2s,第二次以后1s),钥匙状态处理好即可。代码:#include#include#include#include#include#include#include#include#define MOD 1000000007typedef原创 2014-09-20 19:58:02 · 2255 阅读 · 0 评论 -
poj 5024&&&2014 ACM/ICPC Asia Regional Guangzhou Online 1003(预处理)
http://acm.hdu.edu.cn/showproblem.php?pid=5024分析:预处理每个点在八个方向的射线长度,再枚举八种L形状的路,取最大值。注意题意是求一条最长路,要么一条直线,要么只有一个90角,即L型。其实直线就是L形的一个方向长度为0。代码:#include#include#include#include#include#include#i原创 2014-09-20 19:51:29 · 1851 阅读 · 0 评论 -
icpc live archive6454(状压搜索)
https://icpcarchive.ecs.baylor.edu/external/64/6454.pdf求最少的灯照亮所有.的区域,但不能照到#号区域,可以照到界限之外,每个.号上只能放一盏灯。灯照的区域为L形,灯在拐角处。大多数灯是这样没错,但有一盏灯比较特殊,可以是L的其他三种旋转体。状态压缩搜索,状态为放置的灯的状态,(.)点最多只有15个,做好序号可以直接存进一个int型里。原创 2014-09-06 22:23:43 · 849 阅读 · 0 评论 -
icpc live archive6455(状压搜索)
https://icpcarchive.ecs.baylor.edu/external/64/6455.pdf原创 2014-09-06 22:27:39 · 661 阅读 · 0 评论 -
poj1840(暴力+hash)
思路:枚举x1,x2,并将结果存进原创 2014-08-20 19:52:09 · 628 阅读 · 0 评论 -
UVA 1354 - Mobile Computing(暴力枚举子集)
G - Mobile ComputingTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThere is a mysterious planet called Yaen, whose space is 2-dim原创 2014-08-03 22:01:12 · 1726 阅读 · 0 评论 -
poj2741 Colored Cubes(dfs)
比较恶心的一题,大白上已有详细原创 2014-08-20 19:07:39 · 563 阅读 · 0 评论 -
poj 3221Diamond Puzzle(bfs+状压)
Diamond PuzzleTime Limit: 2000MS Memory Limit: 131072KTotal Submissions: 1394 Accepted: 762DescriptionA diamond puzzle is played on a tessellated hexagon like the原创 2014-08-07 20:23:49 · 561 阅读 · 0 评论 -
poj Children of the Candy Corn(裸bfs+一点技巧)
Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9614 Accepted: 4170DescriptionThe cornfield maze is a popular Halloween treat.原创 2014-08-19 20:37:14 · 554 阅读 · 0 评论 -
1176. Two Ends(搜索破解此题)
I - Problem ITime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionIn the two-player game "Two Ends", an even number of cards is lai原创 2014-08-12 20:00:31 · 760 阅读 · 0 评论 -
zoj 1136(同余+bfs)
题意:求用m个数字组成n的倍数原创 2014-08-14 11:24:54 · 882 阅读 · 0 评论 -
ZOJ Problem Set - 3795(缩点拓补)
题意:每条信息说明了两个一定不在一个集合里的人,求最少情况集合可以划分为多少子集。一看就是拓补树的最高层数,但题意中隐含了可能有环(>=关系偏序),所以要先缩点,再拓补。当然,缩点之后图中没有环,直接dfs记忆化也是ok的。代码:#include#include#include#include#include#include#include#include#define原创 2014-12-02 12:49:00 · 681 阅读 · 0 评论 -
poj 1190(dfs剪枝)
先初始化算出n层蛋糕所需的最小体积,用其剪枝,可以大大提升速度。代码:#include#include#include#include#include#include#include#define rep(i,a,b) for(int i=(a);i<(b);i++)#define rev(i,a,b) for(int i=(a);i>=(b);i--)#define c原创 2014-11-30 15:36:35 · 552 阅读 · 0 评论 -
HDU1560:DNA sequence(IDA*)
求一DNA串包含所有给定字串。ida*剪枝,预测函数为个匹配串为匹配部分最大长度。代码:#include#include#include#include#include#include#include#define rep(i,a,b) for(int i=(a);i<(b);i++)#define rev(i,a,b) for(int i=(a);i>=(b);i--)原创 2014-11-30 15:43:51 · 514 阅读 · 0 评论 -
poj1184 聪明的打字员(双向搜索)
双向搜索,同时从起点和终点开始搜索,当if(mark[s.sta][s.site][s.fl] == -1)时就代表从两端的搜索范围开始出现交叉点,即得到最小值。代码:#include #include #include #include #include #include #include #include #include using namespace std;原创 2014-11-30 16:02:42 · 1144 阅读 · 0 评论 -
poj 3635(搜索)
我刚开始用dp做,超时了,看了别人博客重写ac的。个人觉得此题更偏向搜索,dp数组只是记录最佳状态的标记。#include#include#include#include#include#include#include#include#define rep(i,a,b) for(int i=(a);i<(b);i++)#define rev(i,a,b) for(int原创 2014-11-30 14:31:05 · 589 阅读 · 0 评论 -
HDU 1429 胜利大逃亡(状态,宽搜)
A - 胜利大逃亡(续)Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢原创 2014-07-01 14:23:57 · 509 阅读 · 0 评论 -
1026: The true love(简单bfs)
1026: The true loveTime Limit: 1 Sec Memory Limit: 128 MB[Submit][Status][Web Board]Problem Description不可一世大魔王认为他自己是世界上最聪明的人。 于是他想让魔镜确认一下。于是他向魔镜问道。“魔镜魔镜,谁是世界上最聪明的人?”。魔镜却说出了另一个名字”Icy”。原创 2014-06-13 14:59:00 · 631 阅读 · 0 评论 -
uva live 6479
https://icpcarchive.ecs.baylor.edu/external/64/6479.pdf思路:原创 2014-09-01 08:47:43 · 518 阅读 · 0 评论 -
HDU 2089 不要62(数位 dp)
http://acm.hdu.edu.cn/showproblem.php?pid=2089原创 2014-09-10 23:16:35 · 529 阅读 · 0 评论 -
hdu1664 Different Digits (搜索)
Different DigitsTime Limit: 10000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 734 Accepted Submission(s): 173Problem DescriptionGiven a po原创 2014-08-18 16:42:29 · 1275 阅读 · 0 评论 -
UVA 3523(预处理+状态压缩)
I - The Morning after HalloweenTime Limit:12000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionYou are working for an amusement park as an operat原创 2014-08-03 20:40:53 · 752 阅读 · 0 评论 -
HDU1226超级密码(宽搜+记忆化搜索)
B - 超级密码Time Limit:10000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息原创 2014-07-01 18:49:33 · 568 阅读 · 0 评论 -
POJ 1088(水记忆化搜索)
G - 滑雪Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升原创 2014-07-01 21:25:30 · 560 阅读 · 0 评论 -
HDU1026 Ignatius and the Princess I 优先队列宽搜+路径输出
K - Ignatius and the Princess ITime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe Princess has been abducted by the BEelzebub f原创 2014-06-29 09:23:28 · 644 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem(简单回溯)
Problem BTime Limit : 4000/2000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 11 Accepted Submission(s) : 8Problem DescriptionA ring is compose of n原创 2014-05-27 16:35:06 · 453 阅读 · 0 评论 -
hdu 2337 Escape from Enemy Territory (预处理+二分+宽搜)
C - Escape from Enemy TerritoryTime Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA small group of commandos has infiltrated deep原创 2014-07-01 10:08:49 · 580 阅读 · 0 评论 -
HDU1180 诡异的楼梯
N - 诡异的楼梯Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionHogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向. 比如下面原创 2014-06-29 17:12:51 · 443 阅读 · 0 评论 -
HDU1728 逃离迷宫 BFS
L - 逃离迷宫Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gl原创 2014-06-29 21:56:23 · 441 阅读 · 0 评论 -
HDU1258:Sum It Up(DFS)
H - Sum It UpTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionGiven a specified total t and a list of n integers, find all distin原创 2014-06-29 20:50:01 · 407 阅读 · 0 评论 -
POJ 3411(搜索)
B - Paid RoadsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA network of m roads connects N cities (numbered from 1 to N). There may be more than one road原创 2014-07-01 10:25:06 · 521 阅读 · 0 评论 -
POJ 1321-棋盘问题(Cmn深度搜索)好题
I - 棋盘问题Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对原创 2014-07-02 14:03:16 · 554 阅读 · 0 评论 -
poj 3134 Power Calculus(迭代加深dfs)
J - Power CalculusTime Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionStarting with x and repeatedly multiplying by x, we can co原创 2014-07-02 19:17:05 · 642 阅读 · 0 评论 -
POJ3740 Easy Finding(Dancing Links)
G - Easy FindingTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionGiven a M× N matrix A. Aij ∈ {0, 1} (0 ≤ i Input原创 2014-07-10 21:00:50 · 510 阅读 · 0 评论 -
2286 The Rotation Game (1,状压 2,迭代加深搜索)
L - The Rotation GameTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThe rotation game uses a # shaped board, which can hold 24 pi原创 2014-08-03 21:18:27 · 604 阅读 · 0 评论 -
UVa 140 - BandWidth (暴力)
E - Krypton FactorTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescription Krypton Factor You have been employed by原创 2014-07-30 22:07:18 · 503 阅读 · 0 评论 -
POJ3249 Test for Job(记忆化搜索)
B - Test for JobTime Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionMr.Dog was fired by his company. In order to support his famil原创 2014-06-15 12:07:43 · 528 阅读 · 0 评论 -
poj1915(滚动数组队列)
Problem GTime Limit : 2000/1000ms (Java/Other) Memory Limit : 60000/30000K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 5Problem DescriptionBackground Mr Somurolo原创 2014-06-02 16:38:46 · 590 阅读 · 0 评论 -
HDU 2102 A计划(宽搜)
Problem DTime Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 17 Accepted Submission(s) : 9Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回原创 2014-05-31 23:00:01 · 528 阅读 · 0 评论