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: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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator