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:三个样例都过了,为什么会错?强烈不服. Posted by:ACM05002 at 2005-08-03 15:27:37 > void main() > { long n,h,f[25],a[25],d[25],t[25]={0},x[25],z[25],y[25],max,he,da,m,i,j,k,l,p; > while(1) > { scanf("%ld",&n); > if(n==0) > break; > scanf("%ld",&h); > for(i=0;i<n;i++) > scanf("%ld",&f[i]); > for(i=0;i<n;i++) > scanf("%ld",&d[i]); > for(i=1;i<n;i++) > scanf("%ld",&t[i]); > for(i=0;i<n;i++) > { z[i]=0; > y[i]=0; > } > max=0; > for(i=0;i<n;i++) > { m=0; > for(l=0;l<=i;l++) > { m=m+t[l]; > a[l]=f[l]; > } > if(m<h*12) > { m=h*12-m; > he=0; > for(j=0;j<n;j++) > z[j]=0; > for(j=0;j<m;j++) > { da=-1; > for(k=0;k<=i;k++) > if(a[k]>da) > { da=a[k]; > p=k; > } > he=he+da; > a[p]=a[p]-d[p]; > if(a[p]<0) > a[p]=0; > z[p]++; > } > } > if(he>max) > { max=he; > for(k=0;k<n;k++) > x[k]=z[k]; > } > } > for(k=0;k<n-1;k++) > printf("%ld, ",5*x[k]); > printf("%ld\nNumber of fish expected: %ld\n\n",5*x[n-1],max); > } > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator