32 lines
600 B
C++
32 lines
600 B
C++
#include<bits/stdc++.h>//万能头文件
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
set<int> s;
|
|
int n, k;
|
|
int count = 0;
|
|
|
|
cin >> n >> k;
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
int x;
|
|
cin >> x;
|
|
s.insert(x);
|
|
}
|
|
//迭代器
|
|
set<int>::iterator it;
|
|
bool found = false;
|
|
for (it = s.begin(); it != s.end(); it++) {
|
|
count++;
|
|
if (count == k) {
|
|
found = true;
|
|
printf("%d\n", *it);
|
|
break;
|
|
}
|
|
}
|
|
if (!found) {
|
|
cout << "NO RESULT" << endl;
|
|
}
|
|
return 0;
|
|
} |