57972023-10-01 14:29:42xxxBájital (80 pont)cpp14Wrong answer 12/80277ms19132 KiB
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)

int main() {
	int n, x;
	cin >> n >> x;
	vector<int> a(n);
	int xs = 0, ns = 0, ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		xs += a[i]/x;
		ns += a[i]%x;
	}

	bool g = true;
	while (g) {
		if (xs > 0 && ns > 0) {
			xs--;
			ns--;
			ans++;
		} else if (xs > 1 && ns == 0) {
			xs -= 2;
			ns += 2;
			ans++;
		} else {
			g = false;
		}
	}

	cout << ans << "\n";

	return 0;
}

SubtaskSumTestVerdictTimeMemory
base12/80
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2004 KiB
3Wrong answer0/218ms2220 KiB
4Wrong answer0/216ms2440 KiB
5Wrong answer0/24ms2684 KiB
6Wrong answer0/217ms2744 KiB
7Wrong answer0/435ms3012 KiB
8Wrong answer0/4131ms3260 KiB
9Wrong answer0/237ms4964 KiB
10Time limit exceeded0/2272ms4448 KiB
11Wrong answer0/239ms6496 KiB
12Time limit exceeded0/2272ms6376 KiB
13Time limit exceeded0/2270ms7136 KiB
14Wrong answer0/237ms8912 KiB
15Wrong answer0/237ms9556 KiB
16Time limit exceeded0/2247ms9196 KiB
17Time limit exceeded0/2266ms10120 KiB
18Time limit exceeded0/2268ms10920 KiB
19Wrong answer0/237ms12432 KiB
20Time limit exceeded0/2270ms12108 KiB
21Time limit exceeded0/2266ms12732 KiB
22Time limit exceeded0/2252ms13412 KiB
23Wrong answer0/42ms13872 KiB
24Accepted4/43ms13812 KiB
25Wrong answer0/43ms14056 KiB
26Accepted4/424ms15244 KiB
27Time limit exceeded0/4270ms14776 KiB
28Wrong answer0/4123ms16632 KiB
29Wrong answer0/474ms17552 KiB
30Accepted2/257ms18200 KiB
31Accepted2/243ms18872 KiB
32Time limit exceeded0/2270ms18436 KiB
33Time limit exceeded0/2277ms19132 KiB