###### POJ 1477 解题报告

 thestoryofsnow 1477 Accepted 132K 16MS C++
/*
ID: thestor1
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <limits>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cassert>

using namespace std;

const int MAXN = 50;

int main()
{
int n;
int nums[MAXN];
int caseno = 1;
while (scanf("%d", &n) && n > 0)
{
int sum = 0;
for (int i = 0; i < n; ++i)
{
scanf("%d", &nums[i]);
sum += nums[i];
}
int avg = sum / n;
int nmoves = 0;
for (int i = 0; i < n; ++i)
{
if (nums[i] > avg)
{
nmoves += nums[i] - avg;
}
}
printf("Set #%d\n", caseno);
caseno++;
printf("The minimum number of moves is %d.\n\n", nmoves);
}
return 0;
}

#### poj1477

2014-04-02 18:19:48

#### poj 1477 Box of Bricks

2012-06-06 16:10:02

#### 北大ACM poj1477

2012-08-02 20:24:22

#### (贪心5.2.8)POJ 1477 Box of Bricks

2013-10-14 18:31:46

#### poj1477（水）

2016-05-17 14:04:35

#### zoj 题单

2011-07-29 18:41:42

#### zoj--题目分类

2011-09-08 17:20:47

#### ZOJ 题目分类

2015-04-14 16:01:01

#### poj1477 box of bricks

2016-03-17 16:29:37

#### 粘一个在UVA和ZOJ都能AC但POJ WR的代码

2012-12-30 00:59:54

POJ 1477 解题报告