38752023-03-03 12:52:13KevinKövek (100 pont)cpp17Accepted 100/10026ms4552 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    int atlag=0;
    int osszeg=0;
    cin >> n;
    int megoldas=n;
    vector<int> vec(n);
    for (int i=0; i<n; i++){
        cin >> vec[i];
        atlag=atlag+vec[i];
    }
    atlag=atlag/n;
    for (int i=0; i<n; i++){
        osszeg=osszeg+vec[i];
        if(osszeg==atlag*(i+1)&&osszeg%atlag==0){
            megoldas--;
        }
    }
    cout << megoldas;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1680 KiB
2Accepted0/026ms2632 KiB
3Accepted5/53ms2280 KiB
4Accepted5/53ms2424 KiB
5Accepted5/53ms2508 KiB
6Accepted5/52ms2748 KiB
7Accepted5/52ms2836 KiB
8Accepted5/52ms2960 KiB
9Accepted7/73ms3140 KiB
10Accepted7/73ms3340 KiB
11Accepted8/82ms3576 KiB
12Accepted8/83ms3692 KiB
13Accepted8/83ms3804 KiB
14Accepted8/84ms3804 KiB
15Accepted8/810ms4016 KiB
16Accepted8/823ms4136 KiB
17Accepted8/826ms4552 KiB