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

Re:说说两个简单公式.

Posted by yxzzy at 2007-08-25 15:15:04 on Problem 2140
In Reply To:说说两个简单公式. Posted by:KosonLau at 2007-04-28 21:22:36
> k=(sqrt(1+8*n)-1)/2,即子序列的长度不会超过k.  接着从1到k一个一个判断 a=(2*n-k*k+k)%(2*k)是否为0,如果是则总数加1,否则继续循环.
> 
> 

数学功底强的人优势很大,先赞一下!

本人数学功底不太扎实,以后要加强了……

不过好像k的范围是k < (sqrt(1+8*n) + 1) / 2

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