提交时间:2023-11-03 21:24:45
运行 ID: 108585
#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 > 0) { a[i+1] += a[i] - sum; cnt++; } } cout << cnt; return 0; }