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 wocha at 2012-04-27 13:02:48 on Problem 1477
#include<stdio.h>
int main()
{
int n,m,i,j,k,l,q,w,e;
int a[222];
e=0;
 while(scanf("%d",&n),n)
 {
		e++;
		if(e!=1) printf("\n");
		int sum=0;
		for(i=1;i<=n;i++)
		 scanf("%d",&a[i]),sum+=a[i];
		 m=sum/n;
	w=0;
		 for(i=1;i<=n;i++)
			{
				if(a[i]>m)
				{
					 w+=(a[i]-m);
				}
			}
			printf("Set #%d\n",e);
printf("The minimum number of moves is ");


			printf("%d.\n",w);
			
	}
}

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