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

艰难AC.... 说下我的方法和错误经验

Posted by xuchang at 2011-02-24 15:35:52 on Problem 1142
1.素数肯定不是答案 加判定如果是素数则直接跳过
2.x不是素数,必定存在10000以内的因子,将10000以内的所有数的Smith数提前算出来存到数组temp[10000]里,从1到10000遍历之,找到第一个a使得x%a==0,x/a<=10000时答案就是temp[a]+temp[x/a] 
3.当x/a>10000时,检查x/a是不是素数,是的话各位相加就返回,不是的话将x/a代入到第2步中,一个递归形成了.......:)
java 610MS ,求大牛BS

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