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 |
本题隐含的一个递推公式本题的工作主要是算出当前Array的C[0...D]数组中每一个元素的值. 其中, (1)C[D]值直接可从输入中取得,即当前Array的CD值. (2)C[1...D-1]的值有如下递推关系: for( i=1 ; i<=D-1 ; i++ ){ C[i]=1; for( k=i ; k<=D-1 ; k++ ) C[i]*=( upper[k+1]-lower[k+1]+1 ); C[i]*=C[D]; } (3)当求得上述C[1...D]值之后,C[0]值代入题中公式便可迎刃而解了: C[0]=B-C[1]*lower[1]-C[2]*lower[2]-...-C[D]*lower[D] Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator