随笔分类 -  数学,数论-排列组合

摘要:做法一 $O(nm)$ 考虑$f(i,j)$为i个+1,j个 1的贡献 $f(i 1,j)$考虑往序列首添加一个$1$,则贡献$1\times$为序列的个数:$C(j+i 1,i 1)$ $f(i,j 1)$考虑首添加一个$ 1$,则贡献为$ 1\times$最大前缀和不为$0$的个数,考虑序列个数 阅读全文
posted @ 2019-09-09 17:11 y2823774827y 阅读(269) 评论(0) 推荐(0)
摘要:题意 n个点的树k种颜色,距离不超过2的点对需颜色不同,求方案数 Code(copy) cpp include include include include include typedef long long LL; const int N=100005; const int MOD=100000 阅读全文
posted @ 2019-07-07 23:51 y2823774827y 阅读(269) 评论(0) 推荐(0)