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 mathsoft at 2006-02-25 16:36:44 on Problem 1011
In Reply To:WA why? Posted by:mathsoft at 2006-02-25 15:56:47
> #include<stdio.h>
> int main()
> {int i,n,sum,b=0,Re,a[65];
>  scanf("%d",&n);
>  while(n!=0)
>  { sum=0;
>    for(i=0;i<n;i++)
>    {scanf("%d",&a[i]);
>     sum+=a[i];
>     if(a[i]>b) b=a[i];}
>   
>   
>   for(i=64;i>=1;i--)
>    if((sum%i==0)&&(sum/i>=b))
>       {Re=sum/i;break;}
>       printf("%d\n",Re);
>   scanf("%d",&n);    
>   }
>  //printf("%d",Re);
> }
>  

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