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 yygy at 2012-11-21 10:04:23 on Problem 2356
设s[i]是前i个数字的和对n取余的结果。
如果存在一个s[i]==0那么找到了解。
如果不存在0的情况。
由于数字只能是1到n-1之间,
那么n个数字的话,必然后有两个相同的。
s[a]-s[b]==0
输出b+1到a这一段序列就行了。

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