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 00403022 at 2005-07-14 00:36:25 on Problem 2478
In Reply To:这样都超时好像在自己的机器上也慢啊 我都把与当前量有关的欧拉函数都提前求了 Posted by:Washington at 2005-07-14 00:15:51
k=n/sushu[j];
    if (k%sushu[j]==0)
       phy[n]=phy[k]*sushu[j];
    else
       phy[n]=phy[k]*(sushu[j]-1);
当n不是素数时,素数[j]是它的最小素因子

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