
母函数
文章平均质量分 67
母函数
西伯利亚松鼠
退役ACMer,退役MOer
展开
-
无限手套 分治 + NTT + 生成函数
solution∏k=0∞aixi2+bixi+1\prod\limits_{k=0}^{∞}a_ix_i^2+b_ix_i+1k=0∏∞aixi2+bixi+1考虑生成函数:考虑生成函数:考虑生成函数:=>∑k=0∞aik2xk+bixixk+xk=>\sum\limits_{k=0}^{∞}a_ik^2x^k+b_ix_ix^k+x^k=>k=0∑∞aik2xk+bixixk+xk=∑k=0∞aik2xk+∑k=0∞bixixk+∑k=0∞xk,(三项分别当作A原创 2021-07-17 09:23:32 · 513 阅读 · 1 评论 -
Interesting Series 计蒜客 FFT + CDQ分治 +生成函数
Interesting SeriessolutionF1=1F_1=1F1=1Fn=a∗Fn−1+1(n≥2)F_n=a*F_{n-1}+1(n≥2)Fn=a∗Fn−1+1(n≥2)=>Fn+1a−1=a∗(Fn−1+1a−1)=>F_n+\frac{1}{a-1}=a*(F_{n-1}+\frac{1}{a-1})=>Fn+a−11=a∗(Fn−1+a−11)Fn−1a−1=an−1(1+1a−1)=>Fn=an−1a−1F_n-\frac{1}{a-1}=a^原创 2021-07-13 11:21:35 · 178 阅读 · 0 评论 -
Dividing HDU-1059 母函数
HDU-1059Marsha 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 co原创 2021-02-14 16:02:02 · 731 阅读 · 1 评论 -
Coin Change HDU-2069 母函数
HDU-2069Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For example, if we have 11 cents, then we can make changes with one 10-cent coin and one 1-cen原创 2021-02-14 08:48:00 · 744 阅读 · 0 评论 -
Big Event in HDU HDU-1171 母函数
HDU-1171Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer College and Software College in 2002.The splitting is absolutely a big event in HDU! A原创 2021-02-14 07:39:18 · 674 阅读 · 0 评论 -
Fruit HDU-2152 母函数
HDU-2152转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。于是,很多人们慕名而来,找Lele买水果。甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,“我要买由M个水果组成的水果拼盘,不过我有个小小的要求,对于每种水果,个数上我有限制,既不能少于某个特定值,也不能大于某个特定值。而且我不要两份一样的拼盘。你随意搭配,你能组出多少种不同的方案,我就买多少份!”原创 2021-02-13 20:40:04 · 758 阅读 · 0 评论 -
Square Coins HDU-1398 母函数
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), i.e., 1-credit coins, 4-credit coins, 9-credit coins, …, and 289-credit coins, are原创 2021-02-13 17:58:53 · 682 阅读 · 0 评论 -
Ignatius and the Princess HDU-1028 母函数
“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 define an equation like this:N=a[1]+a[2]+a[3]+…+a[m];a[i]>0,1<=m<=N;My questio原创 2021-02-13 17:47:15 · 705 阅读 · 1 评论 -
Holding Bin-Laden Captive! HDU-1085 母函数
Don’t be so afraid, guys. Although he hides in a cave of Hang Zhou, he dares not to go out. Laden is so bored recent years that he fling himself into some math problems, and he said that if anyone can solve his problem, he will give himself up!Ha-ha! Obvi原创 2021-02-12 22:50:04 · 626 阅读 · 0 评论 -
排列组合 HDU-1521 母函数
有 n 种物品,并且知道每种物品的数量。要求从中选出 m 件物品的排列数。例如有两种物品A,B,并且数量都是1,从中选2件物品,则排列有"AB","BA"两种。1≤n,m≤101≤n, m≤101≤n,m≤10input2 21 1output2solution指数型母函数,∏i=1n∑j=0a1xjj!,xm的系数为答案指数型母函数,\prod\limits_{i=1}^{n}\sum\limits_{j=0}^{a_1}\frac{x^j}{j!},x^m的系数为答案指数型母函数,i=1原创 2021-02-12 22:05:40 · 1813 阅读 · 1 评论 -
找单词 HDU-2082 母函数
HDU-2802假设有x1个字母A, x2个字母B,… x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,… 字母Z的价值为26。那么,对于给定的字母,可以找到多少价值<=50的单词呢?单词的价值就是组成一个单词的所有字母的价值之和,比如,单词ACM的价值是1+3+14=18,单词HDU的价值是8+4+21=33。(组成的单词与排列顺序无关,比如ACM与CMA认为是同一个单词)。ai≤20a_i≤20ai≤20input21 1 1 0 0 0 0 0 0 0 0 0 0 0 0原创 2021-02-11 20:15:21 · 633 阅读 · 0 评论