75怎么搞
查看原帖
75怎么搞
965061
fengyiqiu楼主2024/8/12 15:41
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,q[10005],he=0;
	cin>>a>>b;
	for(int i=1;i<=a;i++)
	{
		cin>>q[i];
		he+=q[i];
	}
	sort(q+1,q+1+a);
	for(int i=1;i<=a;i++)
		if(q[a]-q[i]>b)
			he=he-q[i];
	//cout<<endl;
	cout<<he;
	return 0;
}

thank you vvvvvvery much

2024/8/12 15:41
加载中...