测了他给的数据,对了,可还是过不了
代码:
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long Barbatoss;
typedef long long Wendy;
typedef long ShaTang;
typedef int LeiZe;
Barbatoss n,a[1000001],b,i,cnt=1,k;
main(){
scanf("%llu%llu",&n,&k);
for(i=1;i<=n;i++)scanf("%llu",&a[i]);
sort(a+1,a+n+1);
b=a[1];
if(k<=0||k>n){
printf("NO RESULT");
return 0;
}
for(i=2;cnt<k;i++){
if(a[i]!=b)cnt++,b=a[i];
}
if(i>n)printf("NO RESULT");
else printf("%llu",a[i-1]);
}