
组合数学
文章平均质量分 84
jerans
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 3252 Round Numbers 组合数
Round Numbers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 12765 Accepted: 4913 Description The cows, as you know, have no fingers or thumbs and thus原创 2017-02-04 17:15:09 · 330 阅读 · 0 评论 -
codeforces 451E. Devu and Flowers 组合数+容斥
题意:n个不同盒子,每个盒子里有ai个小球,总共拿s个,问有多少种选法 如果盒子里求是无限个,直接插板法就可以求了 对于有了个数限制,可以容斥来做,需要去掉的是个数超限的,那么我先保证他个数超限(拿ai+1个),然后对剩下的小球(s-ai-1)按原来的插板法求放法就可以了 #include #define eps 1e-9 #define PI 3.141592653589793 #原创 2017-09-17 00:51:09 · 393 阅读 · 0 评论 -
HDU - 5894 hannnnah_j’s Biological Test 组合数(插板法)
题意是从n个不同的环形排列的座位里选出m个,并且每个之间必须相隔k个 先保证相隔k个,拿出k*(n+1)个,对剩下的插板法来分 n个座位是不同的,所以要枚举每一个做开头, 但m个人是不同的,就会出现类似 选了1 3 8 3 8 1 8 3 1 这种重复情况,所以还要除m n*C(n-1-k*m,m-1)/m #include using namespace std;原创 2017-09-14 00:36:57 · 311 阅读 · 0 评论 -
hdu 6143 Killer Names 容斥||第二类斯特林数
http://acm.hdu.edu.cn/showproblem.php?pid=6143 题意:有m种字符,要求构造两段长度为n的字符串,其中这两段不能有相同的字符 枚举左边选了i种字符,右边可以选1,2....min(n,m-i)种字符 这样就把问题转化为用k种字符构造n长度的字符串的种类有多少种 容斥:单独考虑每一位上的字符都有k种选择,k^n,但会有不够k种的情况,所以要减去只有原创 2017-08-17 20:42:32 · 579 阅读 · 0 评论 -
之江学院2017ACM校赛 C组合数 D递推式 E折半枚举 K思维
C:组合数,插板法,先每天都分k个题,还是n-m*k个题,然后就是将n-m*k分成m各部分(部分可以为零), 也就是原创 2017-06-04 18:27:47 · 600 阅读 · 0 评论 -
qduoj 140 题目6 142 ycb的ACM进阶之路
题目6 发布时间: 2017年5月22日 14:30 最后更新: 2017年5月22日 14:33 时间限制: 1000ms 内存限制: 128M 描述 给n,m,k,求上述方程中( X1 , X2 ... Xn , Y1 , Y2 ... Ym )解的个数(其中Xi>0,Yi>0) |:二进制按位或运算,1|0=1,0|0=0,1|1=1,0|1原创 2017-05-25 21:37:22 · 531 阅读 · 0 评论 -
UVALive - 5002 The Queue树形dp
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3003 题意是有n个员工,n-1条关系,a b ,a是b的上司,很明显树形结构 排队时,上司必须要在前面,求有多少种排列方法 dp【i】表示i的下属的排列方法有多少种 其中叶子节点原创 2017-04-01 16:18:54 · 309 阅读 · 0 评论 -
Codeforces Round #404 (Div. 2) D. Anton and School - 2 排列组合好题
D. Anton and School - 2 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As you probably know, Anton goes to原创 2017-03-20 10:58:05 · 355 阅读 · 0 评论 -
POJ - 1942 D - Paths on a Grid 组合数
Paths on a Grid Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 25331 Accepted: 6324 Description Imagine you are attending your math lesson at school. On原创 2017-02-05 23:56:57 · 253 阅读 · 0 评论 -
POJ - 1850 Code 组合数
Code Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 9600 Accepted: 4592 Description Transmitting and memorizing information is a task that requires diff原创 2017-02-05 23:53:36 · 312 阅读 · 0 评论 -
2017西安网络赛 E. Maximum Flow F. Trig Function 组合数
E. Maximum Flow https://nanti.jisuanke.com/t/17118 从0到n-1,n个点,权值为点标号,每个点都有 向标号大于自己的点有一条有向边,边权为两结点权值异或值 求从0到n-1的最大流量 找到规律是结果为sum(max(i,i^(n-1))(i=1->n-1) 然后就可以根据数位来求这个结果了 #include using n原创 2017-09-28 15:26:12 · 246 阅读 · 0 评论