18932022-12-07 20:45:03JMMirkoKövek (100 pont)cpp17Accepted 100/10026ms5740 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	vector<int> ve(n);
	int e=0,atl,o=-1;
	for(int i=0;i<n;i++){
		cin >> v[i];
	}
	ve[n-1]=v[n-1];
	for(int i=n-2;i>0;i--){
		ve[i]=ve[i+1]+v[i];
	}
	for(int i=1;i<n;i++){
		v[i]=v[i-1]+v[i];
	}
	atl=v[n-1]/n;
	for(int i=0;i<n;i++){
		if(v[i]==atl*(i+1)){
			e++;
			o=i;
		}
	}
	cout << n-e;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1960 KiB
2Accepted0/026ms3396 KiB
3Accepted5/52ms2244 KiB
4Accepted5/52ms2604 KiB
5Accepted5/52ms2656 KiB
6Accepted5/52ms2784 KiB
7Accepted5/52ms2856 KiB
8Accepted5/52ms2988 KiB
9Accepted7/72ms3504 KiB
10Accepted7/72ms3576 KiB
11Accepted8/82ms3776 KiB
12Accepted8/82ms3908 KiB
13Accepted8/83ms3896 KiB
14Accepted8/84ms4232 KiB
15Accepted8/810ms4628 KiB
16Accepted8/823ms5676 KiB
17Accepted8/826ms5740 KiB