| ||||||||||
| 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 | |||||||||
PKU 3233就是连加的,1004的加的二分我是这么写的,不过MS效率不怎么高。。。难道是这个导致TLE?In Reply To:只知道求幂可以二分,这么连加怎么二分呢... Posted by:laisiwei at 2008-10-19 19:09:11 G sum(int _k)
{
G temp;
if(_k==1) return A;
temp=sum(_k/2);
if(_k&0x1)
temp=temp+pow(_k/2+1,&A)+pow(_k/2+1,&A)*temp;
else
temp=temp+pow(_k/2,&A)*temp;
return temp;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator