//这一次居然是因为这里的j++写成了j--我也是醉了。。
//不要挤着眼敲代码,你还没到那个时候!!!!!
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <string.h>
using namespace std;
int buf[1000001];
int main()
{
int n;
int m;
int tmp;
while(scanf("%d%d",&n,&m)!=EOF)
{
memset(buf,0,sizeof(int));
for(int i=0;i<n;i++)
{
scanf("%d",&tmp);
buf[tmp+500000]++;
}
int cnt=0;
for(int j=1000000;j>=0;j--)//这一次居然是因为这里的j++写成了j--我也是醉了。。
{
if(cnt==m)break;
if(buf[j])
{
cnt++;
printf("%d ",j-500000);
}
}
printf("\n");
}
return 0;
}
//不要挤着眼敲代码,你还没到那个时候!!!!!
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <string.h>
using namespace std;
int buf[1000001];
int main()
{
int n;
int m;
int tmp;
while(scanf("%d%d",&n,&m)!=EOF)
{
memset(buf,0,sizeof(int));
for(int i=0;i<n;i++)
{
scanf("%d",&tmp);
buf[tmp+500000]++;
}
int cnt=0;
for(int j=1000000;j>=0;j--)//这一次居然是因为这里的j++写成了j--我也是醉了。。
{
if(cnt==m)break;
if(buf[j])
{
cnt++;
printf("%d ",j-500000);
}
}
printf("\n");
}
return 0;
}