52021-01-07 20:28:39mraronKövek (100 pont)golangForditási hiba
#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;
}
Forditási hiba
exit status 1