51432023-04-20 03:41:46tomi7Bájital (80 pont)cpp11Wrong answer 20/8039ms5752 KiB
// Source: https://usaco.guide/general/io

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

/*long long lko(unsigned long long n, unsigned long long m){
	if(n%m==0 || m%n==0){
		return min(n, m);
	}
	if(n>m){
		return lko(n%m, m);
	}else{
		return lko(m%n, n);
	}
}*/

int main() {
	int n;
	int x;
	cin>>n>>x;
	vector<int> a(n);
	unsigned long long valasz=0;
	unsigned long long es=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		valasz+=a[i]/x;
		es+=a[i]%x;
	}
	if(es>=valasz){
		cout<<valasz<<'\n';
	}else{
		for(int i=0;i<n;i++){
			if(es+x>=valasz-1){
				valasz--;
				break;
			}else{
				es+=x;
				valasz--;
			}
		}
		cout<<valasz<<'\n';
	}
}
SubtaskSumTestVerdictTimeMemory
base20/80
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms1932 KiB
3Wrong answer0/23ms2144 KiB
4Wrong answer0/23ms2352 KiB
5Wrong answer0/23ms2436 KiB
6Wrong answer0/23ms2692 KiB
7Wrong answer0/43ms2788 KiB
8Wrong answer0/43ms2996 KiB
9Wrong answer0/237ms3932 KiB
10Wrong answer0/239ms4164 KiB
11Wrong answer0/237ms4208 KiB
12Wrong answer0/237ms4292 KiB
13Wrong answer0/237ms4284 KiB
14Wrong answer0/239ms4280 KiB
15Wrong answer0/237ms4280 KiB
16Wrong answer0/237ms4188 KiB
17Wrong answer0/237ms4428 KiB
18Wrong answer0/237ms4516 KiB
19Wrong answer0/237ms4264 KiB
20Wrong answer0/237ms4356 KiB
21Wrong answer0/237ms4584 KiB
22Wrong answer0/237ms4608 KiB
23Wrong answer0/43ms4000 KiB
24Accepted4/42ms3996 KiB
25Accepted4/43ms3980 KiB
26Accepted4/423ms4816 KiB
27Wrong answer0/437ms5040 KiB
28Wrong answer0/437ms5260 KiB
29Accepted4/439ms5356 KiB
30Accepted2/237ms5468 KiB
31Accepted2/237ms5668 KiB
32Wrong answer0/237ms5752 KiB
33Wrong answer0/237ms5648 KiB