14352022-10-01 19:27:44tomi7Kövek (100 pont)cpp11Accepted 100/10026ms4592 KiB
// Source: https://usaco.guide/general/io

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

int main() {
	int n;
	cin>>n;
	vector<int> a(n);
	int atlag=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		atlag+=a[i];
	}
	atlag/=n;
	int valasz=n-1;
	int osszeg=0;
	for(int i=0;i<n-1;i++){
        osszeg+=a[i];
        if(osszeg%(i+1)==0){
			if(osszeg/(i+1)==atlag){
			   valasz--;
		    }
		}
	}
    cout<<valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1816 KiB
2Accepted0/026ms2712 KiB
3Accepted5/52ms2208 KiB
4Accepted5/52ms2464 KiB
5Accepted5/52ms2660 KiB
6Accepted5/52ms2812 KiB
7Accepted5/52ms3004 KiB
8Accepted5/52ms3204 KiB
9Accepted7/72ms3412 KiB
10Accepted7/72ms3488 KiB
11Accepted8/82ms3484 KiB
12Accepted8/82ms3612 KiB
13Accepted8/83ms3704 KiB
14Accepted8/84ms3732 KiB
15Accepted8/89ms4008 KiB
16Accepted8/823ms4208 KiB
17Accepted8/826ms4592 KiB