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:真的很帅,请路过的大牛能解释下其中的原理,先谢了!

Posted by 19880901 at 2011-04-01 18:30:25 on Problem 2407
In Reply To:真的很帅,请路过的大牛能解释下其中的原理,先谢了! Posted by:nothing828 at 2010-03-13 14:09:28
> for(int i = 2;i*i <= n;++i){
> 	if( n % i == 0 ){
> 		ans = ans - ans/i;
> 		while(n%i == 0){
> 			n /= i;
> 		}
> 	}
> }
> 有点像素数筛法,但具体原理还没有完全明白
就是欧拉函数

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