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

给个公式 可能有用 0MS算法

Posted by i_love_c at 2007-02-23 08:00:49 on Problem 2590
1步   1值 1*1
2步   2值
3步   4值 2*2
4步   6值
5步   9值 3*3
..    ..
n 是步子 ((n+1)/2)的平方就是值或者是在中间的值
i=(int)sqrt(value);		
a=i*i;
b=(i+1)*(i+1);
然后a b再与value做比较就出来了(不用循环直接出来)
下面是几组数据 希望有帮助

8
59 4512  输出133

45 654   输出49
4 1545   输出78
..  ..   ...




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