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

利用数学

Posted by 8013 at 2004-03-20 11:32:39 on Problem 1604
In Reply To:怎么加速啊,有什么更快的算法吗? Posted by:dexter at 2004-03-07 21:17:36
我记得没错的话,是求n!的最后一位非零的吧?记为f(n)
根据式子
                    n-1
   (5n)! =  (10^n)n! ∏(5i+1)(5i+2)(5i+3)(5i+4)/2
                     i=0

可证明  f(5n)≡(2^n)f(n) (mod10)就可以了

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