#include<iostream>
using namespace std;
const int N=1e4+10;
int a[N];
int st[N];//标记数组
int n,k;
int main(){
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>x;
if(st[x]==0){
st[x]=1;
num++;
}
}
if(k>num){
cout<<"NO RESULT\n";
return 0;
}
for(int i=0;i<=30000;i++){
if(st[i]){
k--;
}
if(k==0){
cout<<i<<endl;
return 0;
}
}
}
标签:return,cout,int,cin,整数,st,num From: https://www.cnblogs.com/chenxinyue/p/17227727.html