![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DP
oBiyingo
这个作者很懒,什么都没留下…
展开
-
hdu 1421 dp
dp啊 #include using namespace std; #include #include #include long long dp[2005][2005],a[2005]; int main() { int n,k; while(scanf("%d%d",&n,&k)==2) { int i,j; f原创 2013-05-31 19:17:33 · 351 阅读 · 0 评论 -
hdu 1587 简单完全背包
背包呢 #include using namespace std; #include #include int dp[100000],c[10000],w[100000]; int max(int x,int y) { return x>y?x:y; } int main() { int n,m; while(cin>>n>>m) {原创 2013-05-31 19:19:38 · 344 阅读 · 0 评论 -
hdu 2159 二维费用背包
#include using namespace std; #include #include int dp[205][205],c[200],w[200]; int n,m,k,s; int main() { int i,j; while(cin>>n>>m>>k>>s) { memset(dp,0,sizeof(dp));原创 2013-05-31 19:22:42 · 420 阅读 · 0 评论 -
hdu 1546 01背包
#include using namespace std; #include #include #include int c[1005],v[1005],dp[1005]; int main() { int n,m; while(cin>>n,n) { memset(c,0,sizeof(c)); memse原创 2013-05-31 19:23:27 · 435 阅读 · 0 评论 -
hdu 3466 01背包
#include using namespace std; #include #include #include struct item{ int p,q,v; bool operator < (const item it) const { return q-p<it.q-it.p; } }ll[510]; int dp[5原创 2013-05-31 19:24:56 · 331 阅读 · 0 评论 -
hdu 1176 dp近似数塔
#include using namespace std; #include #include int dp[100005][15]; int max3(int x,int y,int z) { if(x>=y && x>=z) return x; else if(y>=x && y>=z) return y; else原创 2013-05-31 19:26:07 · 356 阅读 · 0 评论 -
POJ 3211 Washing Clothes (0/1背包)
题目很有意思,很好理解,挺好的一道背包问题 只需将每种颜色分别用01背包方法求出最接近于该颜色时间总和一半的时间,然后用该颜色时间总和减去它。 最后将每种颜色所花费的时间累加即可。 #include using namespace std; #include #include struct cclothes{ int原创 2013-09-05 11:15:04 · 384 阅读 · 0 评论