题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1963//多重背包#include #include #include using namespace std;const int maxn = 1000000 + 10;#define N 15long...
分类:
其他好文 时间:
2015-02-20 09:41:50
阅读次数:
142
多重背包+完全背包 容易被生活中的“常识”、定式思维坑到
分类:
其他好文 时间:
2015-02-19 12:53:21
阅读次数:
140
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2191题意:标准的多重背包,由于数据量较小,可转化为0-1背包。/*悼念512汶川大地震遇难同胞——珍惜现在,感恩生活Time Limit: 1000/1000 MS (Java/Others) M...
分类:
其他好文 时间:
2015-02-17 22:16:36
阅读次数:
152
题意:有n种纸币,已知每种纸币的面值和数量,求所能凑成的不超过cash的最大总面值。分析:这道题自己写了一下TLE了,好可耻。。找了份比较简洁的代码抄过来了。。poj1276 1 #include 2 #include 3 4 const int maxn = 12; 5 const int ...
分类:
系统相关 时间:
2015-02-13 23:35:46
阅读次数:
283
hdu1059题意,现在有价值为1、2、3、4、5、6的石头若干块,块数已知,问能否将这些石头分成两堆,且两堆价值相等。很显然,愚蠢的我一开始并想不到什么多重背包二进制优化```因为我连听都没有听过```不得不吐槽自己的知识面太窄```于是,我用了母函数写这题,母函数的做法并没有问题,但是由于这道题...
分类:
其他好文 时间:
2015-02-13 16:20:09
阅读次数:
187
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection ...
分类:
其他好文 时间:
2015-02-12 09:24:41
阅读次数:
459
又到了选课的时间了,xhd看着选课表发呆,为了想让下一学期好过点,他想知道学n个学分共有多少组合。你来帮帮他吧。(xhd认为一样学分的课没区别)
Input
输入数据的第一行是一个数据T,表示有T组数据。
每组数据的第一行是两个整数n(1 <= n <= 40),k(1 <= k <= 8)。
接着有k行,每行有两个整数a(1 <= a <= 8),b(1 <= b <= 10),表示学分为a的课有b门。
Output
对于每组输入数据,输出一个整数,表示学n个学分的组合数。...
分类:
其他好文 时间:
2015-02-11 23:23:00
阅读次数:
432
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(without change) and he known th...
分类:
其他好文 时间:
2015-02-11 16:46:46
阅读次数:
187