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:yiyiyi4321的解法详细说明,说的不太好,大家多试一些例子吧。

Posted by xiaoyuanwang at 2007-05-17 12:24:10 on Problem 1844
In Reply To:Re:yiyiyi4321的解法详细说明,说的不太好,大家多试一些例子吧。 Posted by:level at 2006-10-18 14:13:54
同意楼主的思想.因为我也是这么想的,也是这么做的.也是这么过的.
证明很简单啊.
比如说有个数N,sum是1-i的和.如果sum=N,那么就不用说了,如果sum>N;
rest=sum-N,
rest%2==1.那么就不能找到这样解,这点我想大家都了解.
当他是偶数的时候就一定存在解.
原因是如果rest/2<=i,那么就已经找到解了,就是1+...-rest/2+...i ,明白吧.
如果rest/2>i,那么rest=rest-i*2;
剩下的rest/2就一定会<=i-1的.
因为减去之后sum=1+....(i-1)-i了.
呵呵.总之就是看rest的奇偶问题了.
哎,总之就这样了.自己都绕糊涂了,
自己举几个例子就能发现规律.

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