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 200730690105 at 2010-02-22 06:09:51 on Problem 2348
这里只是说说个人理解,如有错误以Discuss中大牛们的阐述为准

现有状态(x,y) (设x>0且y>0,其它情况自行考虑)
1)当x=y时,显然先手胜
2)不妨设x<y
那么(x+y,y)的下一步必定为(x,y),所以(x+y,y)和(x,y)的结果必然相反,其中有一种状态可以先手胜,另一种后手胜
对于任意k>=2,状态(x+ky,y)可以通过从x+ky那堆去掉(k-1)y个石子变成(x+y,y),也可以通过从x+ky那堆去掉ky个石子变成(x,y),于是这两种选择(注意:这是自主的选择)必然有一种可以获胜,所以当k>=2时(x+ky,y)必胜

可以用递归实现~~



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