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 |
哪位好人帮忙一下啊In Reply To:WA了,这题有什么要注意的啊,内附核心想法 Posted by:hudedi at 2006-05-01 13:17:14 > 用score[a][b]表示选取b个人的时候,使|d-p|==a的时候|d+p|的值 > 然后用worth[a][b][]来记录已经选取了哪些人 > memset(score,0,sizeof(score)); > for(ii=1;ii<=n;ii++) > { > for(jj=m-1;jj>0;jj--) > for(kk=0;kk<=40*m-jury[ii].dec;kk++) > if(score[kk][jj]&&score[kk][jj]+jury[ii].add>score[kk+jury[ii].dec][jj+1]) > { > score[kk+jury[ii].dec][jj+1]=score[kk][jj]+jury[ii].add; > delieve(kk,kk+jury[ii].dec,jj); > worth[kk+jury[ii].dec][jj+1][jj+1]=ii; > } > > if(jury[ii].add>score[jury[ii].dec][1]) > { > score[jury[ii].dec][1]=jury[ii].add; > worth[jury[ii].dec][1][1]=ii; > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator