15072022-11-21 15:23:58teodorbatkaiKövek (100 pont)cpp11Accepted 100/10026ms5244 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){
    int n, x = 0;
    long long b = 0, c = 0;
    cin >> n;
    vector<long long> a(n);
    for(int i = 0; i < n; i++){
        int h;
        cin >> h;
        b += h;
        a[i] = b;
    }
    c = b / n;
    for(int i = 0; i < n; i++){
        if(a[i] != c*(i+1)){
            x++;
        }
    }
    cout << x << endl;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1812 KiB
2Accepted0/026ms3360 KiB
3Accepted5/52ms2208 KiB
4Accepted5/52ms2408 KiB
5Accepted5/52ms2528 KiB
6Accepted5/52ms2776 KiB
7Accepted5/52ms2980 KiB
8Accepted5/52ms3088 KiB
9Accepted7/72ms3156 KiB
10Accepted7/72ms3124 KiB
11Accepted8/82ms3324 KiB
12Accepted8/82ms3404 KiB
13Accepted8/83ms3560 KiB
14Accepted8/84ms3936 KiB
15Accepted8/89ms4124 KiB
16Accepted8/823ms5116 KiB
17Accepted8/825ms5244 KiB