Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这个不是容斥原理吧

Posted by y07yangruilong at 2008-05-25 11:05:38 on Problem 3046
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator