49712023-04-08 00:41:26TomaSajtKövek (100 pont)cpp17Accepted 100/10010ms5064 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(0), ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> v(n), ps(n);
  for (auto &a : v)
    cin >> a;
  partial_sum(v.begin(), v.end(), ps.begin());
  int target = ps.back() / n;
  int res = 0;
  for (int i = 0; i < n; i++)
    res += ps[i] != target * (i + 1);
  cout << res;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/03ms1828 KiB
2Accepted0/010ms3484 KiB
3Accepted5/53ms2228 KiB
4Accepted5/53ms2316 KiB
5Accepted5/53ms2544 KiB
6Accepted5/53ms2752 KiB
7Accepted5/52ms2740 KiB
8Accepted5/52ms2868 KiB
9Accepted7/72ms2952 KiB
10Accepted7/73ms3080 KiB
11Accepted8/83ms3184 KiB
12Accepted8/83ms3384 KiB
13Accepted8/83ms3492 KiB
14Accepted8/83ms3556 KiB
15Accepted8/86ms4132 KiB
16Accepted8/89ms4920 KiB
17Accepted8/810ms5064 KiB