【组合数学|母函数】
riba2534
没有谁生来就是神牛,而千里之行,始于足下!
展开
-
HDU1398 Square Coins(母函数,无限制的)
Problem Description People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=17^2原创 2018-02-01 10:44:42 · 473 阅读 · 0 评论 -
HDU1709 The Balance(母函数,有限制的)
Problem Description Now you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you should find out the qualities which原创 2018-02-01 14:50:50 · 271 阅读 · 0 评论 -
HDU1028 Ignatius and the Princess III(整数划分,母函数模板题,无限制)
Problem Description “Well, it seems the first problem is too easy. I will let you know how foolish you are later.” feng5166 says. “The second problem is, given an positive integer N, we de原创 2018-01-31 16:12:38 · 698 阅读 · 0 评论 -
HDU1085 Holding Bin-Laden Captive!(母函数,有限制的)
Problem Description We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China! “Oh, God!原创 2018-01-31 17:15:50 · 350 阅读 · 0 评论 -
HDU1059 Dividing(母函数,有限制)
Problem Description 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原创 2018-02-01 16:10:25 · 264 阅读 · 0 评论 -
HDU1521 排列组合(指数型母函数,有限制的)
Problem Description 有n种物品,并且知道每种物品的数量。要求从中选出m件物品的排列数。例如有两种物品A,B,并且数量都是1,从中选2件物品,则排列有”AB”,”BA”两种。Input 每组输入数据有两行,第一行是二个数n,m(1Output 对应每组数据输出排列数。(任何运算不会超出2^31的范围)Sample Input2 21原创 2018-02-02 10:03:34 · 360 阅读 · 0 评论 -
母函数总结
母函数总结概述母函数,又称生成函数,是ACM竞赛中经常使用的一种解题算法,常用来解决组合方面的题目。 母函数有两种,一种是指数型母函数一种是普通型母函数普通型母函数普通型母函数通常解决类似如下的问题: 给5张1元,4张2元,3张5元,要得到15元,有多少种组合? 某些时候会规定至少使用3张1元、1张2元、0张5元。 某些时候会规定有无数张1元、2元、5元。原创 2018-02-02 16:32:16 · 650 阅读 · 0 评论 -
HDU6172 Array Challenge(BM线性递推)
Problem Description There’s an array that is generated by following rule. h0=2,h1=3,h2=6,hn=4hn−1+17hn−2−12hn−3−16h0=2,h1=3,h2=6,hn=4hn−1+17hn−2−12hn−3−16h_0=2,h_1=3,h_2=6,h_n=4h_{n-1}+17h_{n-2...原创 2018-09-16 23:12:40 · 635 阅读 · 0 评论