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:为什么是RE啊????大牛帮看看哈..

Posted by xueshanhaizi at 2008-08-20 11:59:30 on Problem 1948
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:
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