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: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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator