绝对,绝对不要像我这样不用数组存数据
(代码↓)
#include <iostream>
using namespace std;
bool p[30005];
int n,k,x,ct;
int main(){
cin>>n>>k;
while(n--){
cin>>x;
p[x]=true;
}
for(int i=1;i<30000;i++){
if(p[x])ct++;
if(ct==k){
cout<<i;
return 0;
}
}
cout<<"NO RESULT";
return 0;
}
一看0pts,下载完数据发现
这个数据数字和数字之间有俩空格?!!
比如这样:
10 3
37 6 44 40 52 73 94 82 89 63