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:按这题的空间限制好像只能用树状数组 Posted by:liulike at 2003-08-14 17:11:10 c[i]=a[i-2^k+1]+……+a[i](k为i在二进制形式下末尾0的个数)。 c[1]=a[1] c[2]=a[1]+a[2]=c[1]+a[2] c[3]=a[3] c[4]=a[1]+a[2]+a[3]+a[4]=c[2]+c[3]+a[4] c[5]=a[5] c[6]=a[5]+a[6]=c[5]+a[6] 若a[k]所牵动的序列为C[p1],C[p2]……C[pm]。 则p1=k,而p(i+1)=pi+2li(li为pi在二进制中末尾0的个数)。 a[1]……a[k]的和S。 S=c[k1]+c[k2]+c[k3] + … + c[km] k(i+1)=ki-2^lki(lki为ki在二进制数中末尾0的个数) Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator