摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4540View Code 1 #include<iostream> 2 const int inf=1<<30; 3 using namespace std; 4 int map[22][22]; 5 int dp[22][22];//表示前i个时刻在第j个位置时的最小消耗能量 6 int n,m; 7 8 int main(){ 9 while(~scanf("%d%d",&n,&m)){10 for(int i=1;i<=n;i+ 阅读全文
posted @ 2013-04-08 20:00 ihge2k 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2452http://acm.hdu.edu.cn/showproblem.php?pid=1501记忆化搜索。。。说的简单点,就是dfs+状态标记。。。View Code 1 #include 2 #include 3 const int MAXN=10000+10; 4 const int inf=1mp[MAXN]; 8 int value[MAXN]; 9 int In[MAXN],Out[MAXN];10 int dp[MAXN][2];11 12 int dfs(int now,int . 阅读全文
posted @ 2013-04-08 08:18 ihge2k 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1224我感觉就是求最长上升上升序列View Code 1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 const int MAXN=110; 5 int n,m; 6 int dp[MAXN]; 7 int value[MAXN]; 8 int path[MAXN]; 9 bool map[MAXN][MAXN];10 11 void Print(int u){12 if(u==-1)retu 阅读全文
posted @ 2013-04-08 08:15 ihge2k 阅读(288) 评论(0) 推荐(0) 编辑