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

求 1到n所有数跟n的最大公约数 之和有没有公式或者快一点的方法(log(n))?

Posted by zouyu9631 at 2006-10-31 15:22:40
最简单的方法,帮助理解我的表达...

int res = 0;
for(int i = 1; i <= n; ++i) res += gcd(i, n);

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