5 | 2021-01-07 20:28:39 | mraron | Kövek (100 pont) | golang | Forditá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;
}
exit status 1