题解
2025-05-23 17:43:54
发布于:上海
3阅读
0回复
0点赞
//我生日:5/25
//这题编号:A525
#include <bits/stdc++.h>
using namespace std;
int a[10010];
int main(){
int n, k;
cin >> n >> k;
for(int i = 0; i < n; i++){
cin >> a[i];
}
sort(a, a + n);
for(int i = 1; i < n; i++){
if(a[i] == a[i - 1]){
for(int j = i; j < n - 1; j++){
a[j] = a[j + 1];
}
i--;
n--;
}
}
if(k < n + 1){
cout << a[k - 1];
}else{
cout << "NO RESULT";
}
return 0;
}
这里空空如也
有帮助,赞一个