16142022-11-29 15:31:39sarminKövek (100 pont)cpp17Wrong answer 10/10026ms4368 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/03ms1680 KiB
2Wrong answer0/026ms2644 KiB
3Accepted5/52ms2052 KiB
4Wrong answer0/52ms2256 KiB
5Accepted5/52ms2460 KiB
6Wrong answer0/52ms2808 KiB
7Wrong answer0/52ms2944 KiB
8Wrong answer0/52ms3172 KiB
9Wrong answer0/72ms3168 KiB
10Wrong answer0/72ms3292 KiB
11Wrong answer0/82ms3400 KiB
12Wrong answer0/82ms3396 KiB
13Wrong answer0/83ms3536 KiB
14Wrong answer0/84ms3560 KiB
15Wrong answer0/89ms3612 KiB
16Wrong answer0/823ms3888 KiB
17Wrong answer0/826ms4368 KiB