#include <iostream>//祖传开头
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];
for (int i = 0 ; i < n ; i ++)
cin >> a[i];
int ans = 0,sum = 0;
for (int i = 0 ; i < n ; i ++)
sum += a[i];
int num = sum / n;
for (int i = 0 ; i < n ; i ++)
a[i] -= num;
for (int i = 0 ; i < n - 1 ; i ++)
{
if (a[i] != 0)
{
ans ++;
a[i + 1] += a[i];
}
}
cout<<ans<<endl;
return 0;
}
思路:贪心
比赛已结束。