57992023-10-01 14:45:21xxxBájital (80 pont)cpp14Wrong answer 12/8039ms5580 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;
	rep(i, n) {
		cin >> a[i];
		xs += a[i]/x;
		ns += a[i]%x;
	}

	
	if (ns >= xs) {
		cout << xs << "\n";
		return 0;
	}
	if ((xs-ns) % (x+1) == 0) {
		cout << xs - ((xs-ns)/(x+1)) << "\n";
	} else {
		cout << xs - ((xs-ns)/(x+1)+1) << "\n";
	}

	cout << ans << "\n";

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/80
1Accepted0/03ms1684 KiB
2Wrong answer0/03ms1848 KiB
3Wrong answer0/23ms2060 KiB
4Wrong answer0/23ms2304 KiB
5Wrong answer0/23ms2484 KiB
6Wrong answer0/23ms2568 KiB
7Wrong answer0/43ms2816 KiB
8Wrong answer0/43ms2920 KiB
9Wrong answer0/239ms3996 KiB
10Wrong answer0/239ms3864 KiB
11Wrong answer0/239ms3992 KiB
12Wrong answer0/239ms4060 KiB
13Wrong answer0/239ms4248 KiB
14Wrong answer0/239ms4336 KiB
15Wrong answer0/237ms4460 KiB
16Wrong answer0/239ms4560 KiB
17Wrong answer0/239ms4712 KiB
18Wrong answer0/237ms4568 KiB
19Wrong answer0/239ms4756 KiB
20Wrong answer0/237ms4848 KiB
21Wrong answer0/237ms4748 KiB
22Wrong answer0/237ms4836 KiB
23Wrong answer0/42ms4040 KiB
24Accepted4/43ms4164 KiB
25Wrong answer0/42ms4248 KiB
26Accepted4/424ms5080 KiB
27Wrong answer0/437ms4956 KiB
28Wrong answer0/439ms5056 KiB
29Wrong answer0/439ms5052 KiB
30Accepted2/237ms5056 KiB
31Accepted2/237ms5268 KiB
32Wrong answer0/239ms5500 KiB
33Wrong answer0/239ms5580 KiB