
组合数学
文章平均质量分 75
Werky_blog
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 2154 color(欧拉函数,Polya定理)
题目:http://poj.org/problem?id=2154这种用欧拉函数优化Polya定理真想不到,只能多做题见识见识类型。证名就不证了,知道方案数L可以转化为就行了#include#include#include#define ll intusing namespace std;const int N=1e5;int n,mod;int pr[N];boo原创 2017-11-07 21:41:54 · 236 阅读 · 0 评论 -
hdu 2082 找单词(母函数 初识)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2082#includeusing namespace std;int a[60],b[60];int main(){ int n,num; scanf("%d",&n); while(n--){ for(int i=0;i<=50;i++){原创 2017-11-09 18:03:22 · 219 阅读 · 0 评论 -
hdu 4045 第二类Stirling数
题目:http://acm.hdu.edu.cn/showproblem.php?pid=4045大意:序号为1到n,选r个东西,序列之差大于等于k,放到m个盒子里。分为两部分:1.C(n-((r-1)*k+r+1),r)。。。。插板法。。。实在不想看高中的东西了2.就是第二类斯特林数了S(n+1,k)=S(n-1,k-1) + kS(n-1,k)#includeus原创 2017-11-15 21:51:26 · 457 阅读 · 0 评论 -
Ural 1017 楼梯问题/整数拆分(01背包/dp/母函数)
题目:https://cn.vjudge.net/problem/URAL-1017大意:建楼梯,每层逐渐减小,至少两层,相当于整数拆分,不能有相等的,求种类数。1.01背包:取上为1,没取为0,取到n的最大种类数。#include <cstdio>#include <cstring>#include <iostream>#include <algo...原创 2018-02-15 18:33:26 · 392 阅读 · 0 评论 -
poj 1664 放苹果(dfs/dp/母函数)
题目:http://poj.org/problem?id=1664Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。Output对输入的每组数...原创 2018-01-08 16:01:36 · 329 阅读 · 0 评论