Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这个不是容斥原理吧In Reply To:Re:dp的详细说明 Posted by:qiqilrq at 2007-10-24 15:44:44 > 设一维数组Cb[]记录了集合S={n1·a, n2·b}的组合数,即Cb[i]记录S的i-组合数。 > 那么集合S`={n1·a, n2·b, n3·c}的k-组合数为: > Cb[k-n3]+Cb[k-n3+1]+…+Cb[k] > 其中,Cb[i]=0 if i<0 or i>n1+n2 > > 可以应用到任何集合S`=S+n·c的情况 > 然后循环地累加加上去就行了 > 实际上我也是看到discuss的问题代码才知道的... 能直接用容斥原理做吗 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator