#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, k;
cin >> n >> k;
vector<int> nums;
for (int i = 0; i < n; ++i)
{
int num;
cin >> num;
nums.push_back(num);
}
sort(nums.begin(), nums.end());
cout << nums[k-1];
return 0;
}
코딩 테스트