摘要: http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=17322裸最大连续子序列 竟然差点拿来当区间dp来做= =#include #include using namespace std; #define INF 100000... 阅读全文
posted @ 2015-01-30 19:12 sola94 阅读(99) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2602题意 : n个骨头 m的容量 给出n个骨头的 value 和 volume 求m能容纳的最大价值思路 : dp[j]=max(dp[j],dp[j-w[i]]+v[i]);#include#i... 阅读全文
posted @ 2015-01-30 16:35 sola94 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 算法入门经典 训练指南 p189#include#include#include#include#includeusing namespace std;struct Item{ int s,b; Item(int s,int b) :s(s),b(b) {} bool operat... 阅读全文
posted @ 2015-01-30 16:04 sola94 阅读(152) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1272这题要求任意两个房间都相通又不能有环即通过并查集求出是否构成最小生成树#include#include#include#includeusing namespace std;#define maxn 1000... 阅读全文
posted @ 2015-01-30 12:32 sola94 阅读(186) 评论(0) 推荐(0) 编辑