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

4次TLE,终于过了

Posted by niuzheng168 at 2009-06-09 02:38:16 on Problem 2680
此题究竟是什么数据,完全折服了
if(n&1)
 a[n]=a[n-1]*2-1
else
 a[n]=a[n-1]*2+1


只不过用了大数的乘法,想不到TLE的理由。。。。


最后先把1000个结果算完再输出。。。。500MS过了。。。。

感觉不是算法的问题,这样的算法应该很快了啊。。。。

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