You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
569 B
32 lines
569 B
#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;
|
|
} |