Pagini recente » Monitorul de evaluare | Cod sursa (job #2201503) | Cod sursa (job #418045) | Infoarena Monthly 2014 - Runda 9, Solutii | Cod sursa (job #3213364)
#include <bits/stdc++.h>
using namespace std;
ifstream in("sdo.in");
ofstream out("sdo.out");
#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second
const int NMAX = 3e6+30;
const int INF = 0x3f3f3f3f;
int n, k, v[NMAX];
void read()
{
in >> n >> k;
for (int i = 1; i <= n; i++)
in >> v[i];
}
void solve()
{
sort(v + 1, v + n + 1);
out << v[k];
}
int main()
{
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
read();
solve();
return 0;
}