![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DFS
文章平均质量分 70
mandmLee
这个作者很懒,什么都没留下…
展开
-
ZOJ 1204 Additive equations
地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=204题意 按顺序输出相加等于in[]的所有组情况Sample Input33 1 2 33 1 2 56 1 2 3 5 4 6Output for the Sample Input1+2=3Cant find any原创 2014-02-20 20:26:54 · 1117 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem - DFS模板题
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1016题意 输入N,求1-N中所有整数相互连接成一个环。并满足相邻两数的值为质数,第一个数为1。思路 很明显的BFS模板题。代码#include #include int n;int visit[25], ans[25];int prim原创 2014-02-18 15:37:51 · 813 阅读 · 0 评论 -
HDU 1501 Zipper
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1501题意 给出字符串a,b,c。判断a,b是否同时满足是c的子序列(a,b包含的字母不能重叠)思路 DFS+记忆化搜索。代码#include #include int map[405][405]; // 注意数组大小char a[201]原创 2014-02-18 16:07:19 · 936 阅读 · 0 评论 -
HDU 2514 Another Eight Puzzle
地址:http://acm.hdu.edu.cn/showproblem.php?pid=2514题意每两个相连的点差要大于1。思路 之前用我是一个点一个点的判断,但是老是错了,最后想了想还是要八个点一起判断。代码#include #include #include int Map[8][8] = { { 0,原创 2014-02-18 16:37:12 · 912 阅读 · 0 评论