• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






Keep Strive

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2012年9月11日

hdu 1258 Sum It Up(深搜)
摘要: 题意:找到不重复的,加起来等于给定的数。连接:http://acm.hdu.edu.cn/showproblem.php?pid=1258View Code #include <iostream>#include <algorithm>using namespace std;int used[15];//标记的数int save[15];//保存更新的数int step[15];//输入的数int n,m;int sum,type;int cmp(int a,int b){ return a>b;}void dfs(int k,int x){ if(k==n) { 阅读全文
posted @ 2012-09-11 14:31 Keep Strive 阅读(215) 评论(0) 推荐(0)
 
hdu 2616 Kill the monster(深搜)
摘要: 题意:找到最小步骤杀死monster连接:http://acm.hdu.edu.cn/showproblem.php?pid=2616View Code #include <iostream>using namespace std;int map[15][3];int used[15];int n;int sum,temp,type;int Min=100000000;void dfs(int k,int m){ if(k==n+1)//当到达第K层的时候就不在递归下去了 { if(m>0) { return; ... 阅读全文
posted @ 2012-09-11 12:24 Keep Strive 阅读(322) 评论(0) 推荐(0)
 
hdu 1180 诡异的楼梯(广搜)
摘要: 题意:给定起点和终点,算时间。注意:判断扩展的点为'|'或者'-'时,到达此点楼梯的状态。本来能有优先队列做的,我犯贱咯!等一天补上优先队列的代码;连接:http://acm.hdu.edu.cn/showproblem.php?pid=1180View Code #include <iostream>using namespace std;#include <queue>const int MAX = 20+10;char map[MAX][MAX];//bool used[MAX][MAX];int starti,startj,n,m 阅读全文
posted @ 2012-09-11 08:52 Keep Strive 阅读(694) 评论(0) 推荐(0)