16102022-11-29 07:12:37sarminKövek (100 pont)cpp17Wrong answer 10/10027ms4440 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {

	int N;
	cin >> N;
	vector<int> K(N);
	int sum = 0;
	for (int i = 0; i < N; i++) {
		cin >> K[i];
		sum += K[i];
	}

	int allWill = sum / N, valami = 0;
	for (int i = 1; i < N; i++) {
		valami += K[i-1] - allWill;
		K[i] += K[i-1] - allWill;
		K[i-1]= allWill;
	}

	cout << valami;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base10/100
1Accepted0/03ms1816 KiB
2Wrong answer0/026ms2764 KiB
3Accepted5/52ms2292 KiB
4Wrong answer0/52ms2316 KiB
5Accepted5/52ms2528 KiB
6Wrong answer0/52ms2748 KiB
7Wrong answer0/52ms2856 KiB
8Wrong answer0/52ms2864 KiB
9Wrong answer0/72ms2868 KiB
10Wrong answer0/72ms3256 KiB
11Wrong answer0/82ms3264 KiB
12Wrong answer0/82ms3344 KiB
13Wrong answer0/83ms3428 KiB
14Wrong answer0/84ms3652 KiB
15Wrong answer0/89ms3792 KiB
16Wrong answer0/823ms3920 KiB
17Wrong answer0/827ms4440 KiB