69672023-12-22 00:20:58999Kövek (100 pont)cpp17Accepted 100/10028ms6372 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	vector<int> v(n+1),prefix(n+1);
	for(int i = 1;i<=n;i++){
		cin>>v[i];
		prefix[i]=v[i]+prefix[i-1];
	}
	int atlag=prefix[n]/n,ans=0;
	for(int i = 1;i<=n;i++){
		if(prefix[i]!=atlag*i)ans++;
	}
	cout<<ans<<endl;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1808 KiB
2Accepted0/028ms3944 KiB
3Accepted5/53ms2752 KiB
4Accepted5/53ms2748 KiB
5Accepted5/53ms2888 KiB
6Accepted5/53ms2968 KiB
7Accepted5/53ms3164 KiB
8Accepted5/53ms3248 KiB
9Accepted7/73ms3444 KiB
10Accepted7/73ms3552 KiB
11Accepted8/83ms3692 KiB
12Accepted8/83ms3880 KiB
13Accepted8/83ms3900 KiB
14Accepted8/84ms3960 KiB
15Accepted8/810ms4408 KiB
16Accepted8/824ms5908 KiB
17Accepted8/827ms6372 KiB