上一页 1 2 3 4 5 6 7 8 9 10 ··· 47 下一页

2014年11月2日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5093二分图最大匹配的经典建图模型,行列分别缩点(连起来的'*' & 'o'),交集有'*'就连边#include #include #include #include #include using namespa... 阅读全文
posted @ 2014-11-02 17:25 LegendaryAC 阅读(493) 评论(2) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5092卡读题,实质是每行取一个点,从上到下找一条路径权值和最小,点可以到达的地方是周围八个格子类似数塔的dp,需要记录路径,当前行由上一行顶上的三个格子转移而来#include #include #include ... 阅读全文
posted @ 2014-11-02 17:22 LegendaryAC 阅读(379) 评论(0) 推荐(0) 编辑

2014年10月30日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1026记录bfs路径,用一个数组记录next前驱的方向,然后递归的时候减回去即可#include #include #include #include using namespace std ;const int ... 阅读全文
posted @ 2014-10-30 11:20 LegendaryAC 阅读(168) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1080二维最长公共子序列#include #include #include using namespace std ;char s1[105],s2[105];int tab[5][5]={{5,-1,-2,-1... 阅读全文
posted @ 2014-10-30 10:26 LegendaryAC 阅读(187) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1054二分图最少顶点覆盖,模板题,双向边最后结果/2#include #include #include using namespace std ;struct node{ int s,t,nxt ;}e[1... 阅读全文
posted @ 2014-10-30 09:29 LegendaryAC 阅读(134) 评论(0) 推荐(0) 编辑

2014年10月29日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1044代码题,没什么好说的,先预处理出两点间距离,然后dfs搜一下找最大值#include #include #include #include using namespace std;const int INF=... 阅读全文
posted @ 2014-10-29 21:35 LegendaryAC 阅读(433) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1052田忌赛马本质就是一个贪心res表示田忌的胜利场次1、田忌最快马快于王的最快马,两个最快马比,res++2、田忌最快马慢于王的最快马,田忌的最慢马和王的最快马比,res--3、田忌最快马等于王的最快马,分三种情... 阅读全文
posted @ 2014-10-29 16:26 LegendaryAC 阅读(295) 评论(0) 推荐(0) 编辑

2014年10月28日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1053#include #include #include #include #include using namespace std; int a[30];char s[1005];int cal(char ... 阅读全文
posted @ 2014-10-28 17:28 LegendaryAC 阅读(986) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1069题意:n种木块问最多可以摆多高,每种有无数个,上面木块的长宽必须分别小于下面木块的长宽注意到每种无数个这个条件是虚的,其实只有三种。dp[i]表示以第 i 块为底可以摆放的最大高度#include #incl... 阅读全文
posted @ 2014-10-28 14:11 LegendaryAC 阅读(137) 评论(0) 推荐(0) 编辑

2014年10月27日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1074状压dp,记录路径求最小值的状压dp非常裸,5分钟就写好了,记录路径有点麻烦,之前没怎么处理过这种问题我的方法是用一个map建立当前状态和前驱状态的映射,输出要按字典序,因为已经按字典序从大到小排好了,所以状... 阅读全文
posted @ 2014-10-27 23:33 LegendaryAC 阅读(204) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 47 下一页