38562023-03-03 12:14:54MatematikaKövek (100 pont)cpp17Accepted 100/10026ms4408 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    int atlag;
    int lepesek=0;
    int osszeg=0;
    cin >> 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))
        {
            lepesek++;
        }
    }
    lepesek=n-lepesek;
    cout << lepesek;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1812 KiB
2Accepted0/026ms2764 KiB
3Accepted5/52ms2140 KiB
4Accepted5/53ms2332 KiB
5Accepted5/53ms2548 KiB
6Accepted5/53ms2764 KiB
7Accepted5/52ms2728 KiB
8Accepted5/52ms2852 KiB
9Accepted7/72ms3104 KiB
10Accepted7/73ms3312 KiB
11Accepted8/82ms3364 KiB
12Accepted8/83ms3364 KiB
13Accepted8/83ms3376 KiB
14Accepted8/84ms3656 KiB
15Accepted8/810ms3884 KiB
16Accepted8/823ms4020 KiB
17Accepted8/826ms4408 KiB