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

Re:怎么才能减少时间啊?500ms

Posted by Web_Board at 2009-08-03 14:01:31 on Problem 1401
In Reply To:Re:怎么才能减少时间啊?500ms Posted by:xcl119xcl at 2007-07-27 11:38:22
打表啦,还能有啥办法
    for(i = 1;i < 15;i ++)
    {
          N5[i] = 5 * N5[i-1];
          }
然后
    for(i = 1;n >= N5[i];i ++)
          result += n/N5[i];
这样至多优化到100+ms,再好的优化代码就比较长了,啰嗦的代码一贯不写-_-

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