272021-01-07 21:56:25mraronKövek (100 pont)cpp11Accepted 100/10025ms2576 KiB
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> k(n);
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> k[i];
    sum += k[i];
  }
  int avg = sum / n;
  sum = 0;
  int moves = 0;
  for (int i = 0; i < n; i++) {
    sum += k[i];
    if (sum != avg * (i+1)) {
      moves++;
    }
  }
  cout << moves << endl;
  return 0;
}
SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/02ms1740 KiB
2Accepted0/025ms2572 KiB
3Accepted5/51ms1720 KiB
4Accepted5/51ms1824 KiB
5Accepted5/51ms1832 KiB
6Accepted5/51ms1720 KiB
7Accepted5/51ms1824 KiB
8Accepted5/51ms1824 KiB
9Accepted7/71ms1820 KiB
10Accepted7/71ms1824 KiB
11Accepted8/81ms1824 KiB
12Accepted8/81ms1720 KiB
13Accepted8/82ms1832 KiB
14Accepted8/83ms1864 KiB
15Accepted8/88ms2052 KiB
16Accepted8/820ms2264 KiB
17Accepted8/824ms2576 KiB