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 wangxuyang at 2008-04-26 19:50:16 on Problem 2980
In Reply To:为什么WA啊? 谢谢!!!! Posted by:y05yxg at 2006-08-19 11:39:55
#include<stdio.h>
#include<math.h>

const int Max=100;
int main()
{
 	int n1,n2,n0,r;
	int i;
	int c[Max+1];
 	int day1,day2,day0;
 	int min;
 	while(scanf("%d%d%d%d",&n1,&n2,&n0,&r)==4&&(n1+n2+n0+r))
 	{
 		
 		day1=0;
        day2=0;
        day0=0;
 		
 		for(i=0;i<=(int )ceil(100.0/(r+2));i++)
 		{
 			day0=n0*(int )(ceil(100.0/r));
 			day1=n1*(int )(i+ceil((100.0-(double)(i*(r+2)))/r));
 			day2=n2*(int )(i+ceil(ceil(100.0-(double)(i*(r-1)))/r));   		
 			c[i]=day0+day1+day2;
 		}
 		min=c[0];
 		for(i=0;i<=ceil(100/(r+2));i++)
		{
 			if(c[i]<min)
 			{
				min=c[i];
 			}
 		}
 		printf("%d\n",min);
 	}
 	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