提交时间:2023-11-01 13:32:58
运行 ID: 108226
#include <iostream> using namespace std; int a[105]; int sum , cnt; int main() { int n; cin >> n; for(int i = 1;i <= n;i++) { cin >> a[i]; sum += a[i]; } sum /= n; for(int i = 1;i <= n;i++) { if(a[i] - sum) { a[i+1] += a[i] - sum; cnt++; } } cout << cnt; return 0; }