![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
生成函数
角落的秋天
在财经大学读计算机的小伙子,已毕业,GitHub: https://github.com/wintercoder
展开
-
HDU 1398 Square Coins
Square CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7952 Accepted Submission(s): 5385Problem DescriptionPeople in Sil原创 2014-07-23 16:01:51 · 589 阅读 · 0 评论 -
HDU 1171 Big Event in HDU【多重背包||母函数】
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1171题意:将财产尽可能对半分 可以以财产的总和的一半为背包上限,求背包最大值。 因为每件物品可以有很多件,所以本题为多重背包问题,#define max(a,b) ( (a) > (b) ? (a) : (b) )#include#inc原创 2014-07-24 14:35:01 · 606 阅读 · 0 评论 -
HDU 1709 The Balance【负次方母函数】
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1709题意:有个天平,给定 左右tc[abs(j-k)] += c[j];原创 2014-07-25 21:38:34 · 612 阅读 · 0 评论 -
HDU 2152 Fruit【带上下界母函数】
#define MAX 1000int c[MAX],tc[MAX];int l[MAX],r[MAX];#include#include#includeint main(){ int n,i,j,k,m;// freopen("in.txt","r",stdin); while(scanf("%d %d",&n,&m)!=EOF){ for(i = 0; i < n; i+原创 2014-07-26 00:31:19 · 600 阅读 · 0 评论 -
HDU 1028 Ignatius and the Princess III【整数拆分】
#include using namespace std;#define MAX 120int main(){ int i,j,k,n;int c[MAX+1],tc[MAX+1]; freopen("a.txt", "r", stdin); while( cin>>n ){for( i = 0; i c[i] = 1;tc[i] =原创 2014-07-23 16:40:51 · 625 阅读 · 0 评论 -
POJ 3734 Blocks【用母函数推公式|矩阵乘法】
#includeint pow_mod(int a,int b,int c){ int res = 1; a = a%c; while(b){ if(b&1) res = (res * a) % c; a = a *a % c; b>>=1; } return res;}int main(){#ifndef ONLINE_JUDGE freopen("原创 2014-07-28 16:35:16 · 713 阅读 · 0 评论 -
HDU 2069 Coin Change【带总数限制的母函数】
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2069因为母函数的话#includeint main(){ int i,j,k,l,m,n; int count[251]={0}; for(n=0;n<=250;n++) for(j=0;j*5<=n;j++) for(k=0;k*10<=n;k++) f原创 2014-07-26 02:51:25 · 572 阅读 · 0 评论 -
HDU 1085 Holding Bin-Laden Captive!
生成函数大法好原创 2014-07-23 17:46:59 · 511 阅读 · 0 评论