58002023-10-01 14:47:34xxxBájital (80 pont)cpp14Wrong answer 54/8037ms5576 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";
	}

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base54/80
1Accepted0/03ms1808 KiB
2Accepted0/03ms2056 KiB
3Accepted2/23ms2276 KiB
4Accepted2/23ms2516 KiB
5Accepted2/23ms2720 KiB
6Accepted2/23ms2880 KiB
7Accepted4/43ms2972 KiB
8Accepted4/43ms2944 KiB
9Wrong answer0/237ms3880 KiB
10Wrong answer0/237ms3744 KiB
11Wrong answer0/237ms3964 KiB
12Wrong answer0/237ms4084 KiB
13Wrong answer0/237ms4168 KiB
14Wrong answer0/237ms4384 KiB
15Wrong answer0/237ms4600 KiB
16Wrong answer0/237ms4684 KiB
17Wrong answer0/237ms4716 KiB
18Wrong answer0/237ms4804 KiB
19Wrong answer0/237ms4804 KiB
20Accepted2/237ms4800 KiB
21Accepted2/237ms5028 KiB
22Accepted2/237ms5024 KiB
23Accepted4/43ms4528 KiB
24Accepted4/42ms4552 KiB
25Accepted4/42ms4568 KiB
26Accepted4/423ms5272 KiB
27Accepted4/437ms5236 KiB
28Accepted4/437ms5232 KiB
29Accepted4/437ms5232 KiB
30Accepted2/237ms5236 KiB
31Accepted2/237ms5236 KiB
32Wrong answer0/237ms5364 KiB
33Wrong answer0/237ms5576 KiB