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 nothing828 at 2010-03-13 14:09:28 on Problem 2407
In Reply To:被这代码,感动得,内牛满面 Posted by:denghongchao at 2009-12-05 15:04:18
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