Pagini recente » Cod sursa (job #541250) | Cod sursa (job #1352885) | Cod sursa (job #3126233) | Monitorul de evaluare | Cod sursa (job #1325071)
/*
Rescriere OLI 2015
Start: 10:45
*/
#include <algorithm>
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
vector < int > V;
void Read()
{
int N, th, x;
fin >> N >> th;
for(int i = 1; i <= N; i++)
{
fin >> x;
V.push_back(x);
}
nth_element(V.begin(), V.begin() + th, V.end());
fout << V[th];
}
int main()
{
Read();
return 0;
}