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 xfxyjwf at 2005-06-12 13:56:55 on Problem 1014
In Reply To:这个题目的数据太弱了吧?用两种可能对立的方法都能ac? Posted by:queyue2004 at 2005-06-12 10:04:37
第一种:
0 0 0 17 0 0
显然不可分,但是4*16=64,64%60=4,4-4=0
第二种方法的正确性可由下表推出:(证明见问题求解的课件)
                    奇数改为 偶数改为
 6的个数大于5          5       4
 5的个数大于6          5       6
 4的个数大于5          5       4
 3的个数大于5          5       4
 2的个数大于4          3       4
 1的个数大于6          5       6
如果可分,则必存在一种正确取法使得:
只取价值为1的时候,差不大于6
取12的时候,差不大于6+4*2 = 14
取123的时候,差不大于14+3*5 = 29
取1234的时候,差不大于29+4*5 = 49
取12345的时候,因为单取6的差不大于5*6 = 30,取123456的差为0,所以取12345的差不大于30

所以去掉差大于60的情况不会导致有解的时候找不到解。

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