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

几乎一样诶 握爪 不过我是到这题水过40道……

Posted by jndx20111221395 at 2012-06-08 03:29:50 on Problem 3624
In Reply To:1A,纪念100题。 Posted by:1001030088 at 2011-10-08 14:01:55
#include<stdio.h>
int bag[13000]={0};
int main(){
	int n,m,M,V,t;
	scanf("%d%d",&n,&m);
	while(n--){
		scanf("%d%d",&M,&V);
		for(int i=m;i>=M;i--){
			t=V+bag[i-M];
			if(t>bag[i])bag[i]=t;
		}
	}
	printf("%d\n",bag[m]);
	return 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