18122022-12-03 21:35:02kdbKövek (100 pont)cpp11Accepted 100/10010ms5348 KiB
#include <iostream>
#include <vector>
#include <map>
#include <queue>
using namespace std;
#define ll long long

ostream& operator<<(ostream& os, vector<int>& input)
{
    for (auto i : input)
    {
        os << i << " ";
    }
    return os;
}

int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int n, q = 0;
    cin >> n;
    vector<int>vec;
    for (size_t i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        q += a;
        vec.push_back(q);
    }
    int m = 0, w = q / n;
    for (size_t i = 0; i < n; i++) if (vec[i] != w*(i+1)) m++;
    cout << m << endl;
    return 0;
}
/*
5
7 3 8 10 2
*/
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1696 KiB
2Accepted0/010ms3136 KiB
3Accepted5/52ms2068 KiB
4Accepted5/52ms2292 KiB
5Accepted5/52ms2500 KiB
6Accepted5/52ms2708 KiB
7Accepted5/52ms2904 KiB
8Accepted5/52ms3092 KiB
9Accepted7/72ms3144 KiB
10Accepted7/72ms3148 KiB
11Accepted8/82ms3372 KiB
12Accepted8/82ms3448 KiB
13Accepted8/82ms3392 KiB
14Accepted8/83ms3796 KiB
15Accepted8/84ms4424 KiB
16Accepted8/89ms5348 KiB
17Accepted8/810ms5152 KiB