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 hudedi at 2006-05-01 15:37:05 on Problem 1015
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:
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