85692024-01-22 11:06:40IgnácBájital (80 pont)cpp17Time limit exceeded 56/80300ms4868 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, x;
	cin >> n >> x;
	long long sum = 0, maxx = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		sum += a;
		maxx += a / x;
	}

	while (sum - maxx * x < maxx) {
		maxx--;
	}

	cout << maxx;
}
SubtaskSumTestVerdictTimeMemory
base56/80
1Accepted0/03ms1876 KiB
2Accepted0/03ms2064 KiB
3Accepted2/24ms2436 KiB
4Accepted2/23ms2660 KiB
5Accepted2/23ms2724 KiB
6Accepted2/23ms2860 KiB
7Accepted4/44ms2948 KiB
8Accepted4/412ms3080 KiB
9Time limit exceeded0/2300ms2508 KiB
10Time limit exceeded0/2275ms2752 KiB
11Time limit exceeded0/2266ms3024 KiB
12Time limit exceeded0/2250ms3060 KiB
13Time limit exceeded0/2280ms3940 KiB
14Time limit exceeded0/2270ms3380 KiB
15Time limit exceeded0/2273ms3552 KiB
16Time limit exceeded0/2238ms3608 KiB
17Time limit exceeded0/2266ms3664 KiB
18Time limit exceeded0/2254ms4680 KiB
19Accepted2/294ms4512 KiB
20Accepted2/263ms4756 KiB
21Accepted2/252ms4840 KiB
22Accepted2/246ms4840 KiB
23Accepted4/43ms4724 KiB
24Accepted4/43ms4724 KiB
25Accepted4/43ms4728 KiB
26Accepted4/423ms4724 KiB
27Accepted4/439ms4868 KiB
28Accepted4/437ms4728 KiB
29Accepted4/437ms4724 KiB
30Accepted2/237ms4760 KiB
31Accepted2/237ms4756 KiB
32Time limit exceeded0/2256ms3888 KiB
33Time limit exceeded0/2273ms3912 KiB