81922024-01-12 17:44:05CsongiKövek (100 pont)cpp17Accepted 100/10027ms5876 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> kovek(n);
	int osszeg = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> kovek[i];
		osszeg += kovek[i];
	}
	osszeg /= n;
	int szamlalo = 0;
	for (int i = 0; i < n; i++)
	{
		if (kovek[i] != osszeg)
		{
			szamlalo++;
		}
		kovek[i + 1] += kovek[i] - osszeg;
	}
	cout << szamlalo;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms2088 KiB
2Accepted0/027ms3316 KiB
3Accepted5/53ms2624 KiB
4Accepted5/53ms2836 KiB
5Accepted5/53ms3052 KiB
6Accepted5/53ms3164 KiB
7Accepted5/53ms3420 KiB
8Accepted5/53ms3512 KiB
9Accepted7/73ms3696 KiB
10Accepted7/73ms3748 KiB
11Accepted8/83ms3752 KiB
12Accepted8/83ms3756 KiB
13Accepted8/83ms3776 KiB
14Accepted8/84ms3816 KiB
15Accepted8/810ms4164 KiB
16Accepted8/824ms4916 KiB
17Accepted8/827ms5876 KiB