#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int poker[ 102 ], num, i, sum = 0, count = 0, average, temp;
cin >> num;
memset( poker, 0, sizeof( poker ) );
for( i = 1; i <= num; i++ )
{
cin >> poker[ i ];
sum += poker[ i ];
}
average = sum / num;
for( i = 1; i <= num; i++ )
{
if( poker[ i ] == average )
{
continue;
}
else if( poker[ i ] > average )
{
temp = poker[ i ] - average;
count++;
}
else if( poker[ i ] < average )
{
temp = poker[ i ] - average;
count++;
}
poker[ i + 1 ] += temp;
}
cout << count << endl;
return 0;
}
wiki 1098 均分纸牌
最新推荐文章于 2023-11-04 19:13:39 发布