Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这样由前向后推,好像还有些重复计算,我改成找前边的,就不超了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator