• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Hug_Sea
博客园    首页    新随笔    联系   管理    订阅  订阅

文章分类 -  DFS

HDU-1010 Tempter of the Bone

摘要:题意:给出N*M的地图,问能否从S到D话费T时间。思路:dfs奇偶剪枝。题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespa 阅读全文
posted @ 2012-06-20 19:55 Hug_Sea 阅读(162) 评论(0) 推荐(0)
HDU-2660 Accepted Necklace

摘要:题意:有n个石头,包含重量和价值,从中挑选最多k个石头做成一条项链,要求重量不大于W,求最大价值。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2660View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream 阅读全文
posted @ 2012-06-19 20:32 Hug_Sea 阅读(135) 评论(0) 推荐(0)
HDU-2614 Beat

摘要:题意:给定一个n*n的矩阵,代表解决问题i到j的难度,前提是要解决越来越难的题,问最多能解决多少题。思路:dfs找出最大值。题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2614View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <io 阅读全文
posted @ 2012-06-19 20:30 Hug_Sea 阅读(125) 评论(0) 推荐(0)
HDU-2181 哈密顿绕行世界问题

摘要:题意:一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市,给出每一个点相邻的点,求每一个序列。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2181View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algor 阅读全文
posted @ 2012-06-18 20:43 Hug_Sea 阅读(172) 评论(0) 推荐(0)
HDU-1572 下沙小面的(2)

摘要:题意:给出n*n的矩阵、代表两点之间的距离,给出k个乘客和乘客要下的站点,起点在0,求从起点到每个站点的最短距离。思路:dfs找出最短距离即可.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1572View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #incl 阅读全文
posted @ 2012-06-18 20:20 Hug_Sea 阅读(128) 评论(0) 推荐(0)
HDU-1258 Sum It Up

摘要:题意:给出sum和n个数,找出满足m(m<=n)个数相加等于sum。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1258View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using 阅读全文
posted @ 2012-06-18 08:58 Hug_Sea 阅读(161) 评论(0) 推荐(0)
HDU-1181 变形课

摘要:题意:给出n个单词,判断是否存在以‘b’开头,‘m’结尾的情况。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1181View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using name 阅读全文
posted @ 2012-06-18 08:56 Hug_Sea 阅读(146) 评论(0) 推荐(0)
HDU-1035 Robot Motion

摘要:题意:给出一图,求跳出此图的步骤,若遇到环则不同输出。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1035View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace 阅读全文
posted @ 2012-06-15 22:07 Hug_Sea 阅读(136) 评论(0) 推荐(0)
HDU-1016 Prime Ring Problem

摘要:题意:给定一个数,输出素数环。思路:dfs。题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1016View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream> 7 using namespace std; 8 const int N=110; 9 10 bool prim 阅读全文
posted @ 2012-06-15 22:04 Hug_Sea 阅读(133) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3