hdu1171专题

hdu1171(母函数或多重背包)

题意:把物品分成两份,使得价值最接近 可以用背包,或者是母函数来解,母函数(1 + x^v+x^2v+.....+x^num*v)(1 + x^v+x^2v+.....+x^num*v)(1 + x^v+x^2v+.....+x^num*v) 其中指数为价值,每一项的数目为(该物品数+1)个 代码如下: #include<iostream>#include<algorithm>

HDU1153——Magic Bitstrings,HDU1171——Big Event in HDU,HDU1261——字串数

HDU1153——Magic Bitstrings 题目描述 问题 - 1153 (hdu.edu.cn) 运行代码 #include <iostream>#include <vector>int main() {long long p;while (std::cin >> p) {if (p == 0) break;if (p == 2) {std::cout << "Imposs

hdu1171 多重背包

如题:http://acm.hdu.edu.cn/showproblem.php?pid=1171 Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer Co

hdu1171多重背包

之前用01背包做,现在用多重背包再来一次http://blog.csdn.net/twenty_seven/article/details/42805157(01背包)       #include<iostream> #include<cstdio> #include<cstring> using namespace std;   int w[55]; int num[5

HDU1171 Big Event in HDU(01背包的转化,多重背包)

题目: Big Event in HDU Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37483    Accepted Submission(s): 13007 Problem Description