
容斥
zstu_zy
博主比较水,喜欢打codeforces,希望可以一起交流
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 4390 容斥
题意可以理解为有k种数,每个都ki个,把这k个数放到n个容器里,保证这n个容器里没有空的。 设f[i]为i个容器里没有空的,g[i]为i个容器里可以为空。 则g[n] = f[n] - c(n,1)f[n-1]+c(n,2)f[n-2] - c(n,3)f[n-3]; 看了好多题解,说这是用归纳法证明,我不知道怎么证明,但是可以用容斥来解释。 f[n] - c(n,1)f[n-1];这个式原创 2016-10-22 14:29:18 · 302 阅读 · 0 评论 -
Codeforces Round #257 (Div. 1) D. Jzzhu and Numbers
D. Jzzhu and Numbers time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Jzzhu have n non-negative integers a1, a2, …, an. We will call a seq...原创 2018-08-17 12:35:46 · 361 阅读 · 0 评论