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

PKU 3233就是连加的,1004的加的二分我是这么写的,不过MS效率不怎么高。。。难道是这个导致TLE?

Posted by majia5 at 2008-10-19 19:11:37 and last updated at 2008-10-19 19:13:52
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:
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