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:这样做为什么错了,不是背包吗,难道有特殊数据In Reply To:这样做为什么错了,不是背包吗,难道有特殊数据 Posted by:zxt at 2008-05-07 22:55:26 for(j=0;j<=15000;j++){ if(N[i-1][j]){ for(k=0;k<n;k++)N[i][j+num*M[k]]++; 你这样正向循环只能针对挂在天平左边的砝码更新状态...如果在右边的话,正向循环会造成“一个砝码多次被挂”右边应该for(int j=15000;j>=0;--j)。根据钩子的正负值分开循环 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator