📅  最后修改于: 2022-03-11 14:44:45.126000             🧑  作者: Mango
#include
#include
using namespace std;
int cmp(int &a,int &b)
{
return a>b;
}
int main()
{
int n;
long int b;
long int sum;
int i;
int count;
int cows[20000];
cin>>n>>b;
for(i=0;i>cows[i];
sort(cows,cows+n,cmp);
sum=0;
count=0;
for(i=0;i=b)
break;
sum+=cows[i];
count++;
}
cout<