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

见内

Posted by Pzjay at 2009-11-04 10:51:21 on Problem 2853
In Reply To:Re:用笨办法太慢了,高手能指点指点吗? Posted by:chqch172443 at 2008-07-08 16:17:44
假设num能分解成从j开始的连续i个数的和,则有i*j+i*(i-1)/2=num;
即i(2*j+i-1)=2*num,则j=(num-i*(i-1)/2)/i;j是大于0的整数,则(num-i*(i-1)/2)%i应为0,然后且满足j>=1即(num-i*(i-1)/2>=i,整理即得:i*(i+1)<=2*num;       ~over~

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