Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:为什么是RE啊????大牛帮看看哈..In Reply To:为什么是RE啊????大牛帮看看哈.. Posted by:20054953 at 2007-08-23 09:50:50 if(dp[j][k-aa[i]]==1&&k>=aa[i]) dp[j][k]=1; if(dp[j-aa[i]][k]==1&&j>=aa[i]) dp[j][k]=1; 你将上面的条件反着写次才可以,那样才能保证k-aa[i]>0,因为小于直接就短路了 。你那样写就可能出现小于0的情况。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator