38502023-03-03 12:09:14Erik_GepardKövek (100 pont)cpp17Accepted 100/10026ms4388 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/52ms2228 KiB
4Accepted5/53ms2440 KiB
5Accepted5/52ms2532 KiB
6Accepted5/52ms2768 KiB
7Accepted5/53ms2980 KiB
8Accepted5/52ms2976 KiB
9Accepted7/73ms3176 KiB
10Accepted7/72ms3304 KiB
11Accepted8/82ms3544 KiB
12Accepted8/82ms3516 KiB
13Accepted8/83ms3524 KiB
14Accepted8/84ms3552 KiB
15Accepted8/810ms3824 KiB
16Accepted8/823ms4004 KiB
17Accepted8/826ms4388 KiB