56202023-08-09 22:11:30999Bájital (80 pont)cpp17Wrong answer 16/8043ms6724 KiB
// Source: https://usaco.guide/general/io

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

signed main() {
	/*int n;cin>>n;int a=0,b=0,currl=0,maxl=0,db=0;
	for(int i=0;i<n;i++){
		cin>>a;
		if(a==b){
			maxl=max(maxl,currl+1);
			if(currl>0){
				db++;
			}
			currl=0;
		}
		else if(i==n-1){
			maxl=max(maxl,currl+1);
			db++;
		}
		else{
			currl++;
		}
		b=a;
	}
	cout<<db<<endl<<maxl<<endl;*/
	int n,x;cin>>n>>x;
	int g=0;
	vector<int> v;
	while(n--){
		int a;cin>>a;
		v.push_back(a%(x+1));
		a-=a%(x+1);
		g+=a/(x+1);	
	}int y=0,z=0,sum=0;
	for(int i : v){
		if(i==x){
			y++;
		}
		else{
			sum+=i;
			z++;
		}
	}
	if(y<=sum){
		cout<<g+y<<endl;
	}
	else {
		while(y<=sum){
			y--;
			sum+=x;
		}
		cout<<g+y<<endl;
	}
}
SubtaskSumTestVerdictTimeMemory
base16/80
1Accepted0/03ms1720 KiB
2Wrong answer0/03ms1972 KiB
3Wrong answer0/23ms2100 KiB
4Wrong answer0/23ms2316 KiB
5Wrong answer0/23ms2524 KiB
6Wrong answer0/23ms2752 KiB
7Wrong answer0/43ms2952 KiB
8Wrong answer0/43ms3032 KiB
9Wrong answer0/243ms5396 KiB
10Wrong answer0/243ms5496 KiB
11Wrong answer0/243ms5616 KiB
12Wrong answer0/243ms5832 KiB
13Wrong answer0/243ms5776 KiB
14Wrong answer0/243ms5812 KiB
15Wrong answer0/243ms5740 KiB
16Wrong answer0/241ms5740 KiB
17Wrong answer0/243ms5884 KiB
18Wrong answer0/243ms5888 KiB
19Wrong answer0/243ms5916 KiB
20Wrong answer0/241ms5972 KiB
21Wrong answer0/243ms5952 KiB
22Wrong answer0/241ms6032 KiB
23Accepted4/42ms4208 KiB
24Accepted4/42ms4292 KiB
25Accepted4/42ms4344 KiB
26Accepted4/427ms6436 KiB
27Wrong answer0/441ms6436 KiB
28Wrong answer0/443ms6512 KiB
29Wrong answer0/441ms6436 KiB
30Wrong answer0/243ms6640 KiB
31Wrong answer0/243ms6724 KiB
32Wrong answer0/243ms6576 KiB
33Wrong answer0/243ms6704 KiB