Pagini recente » Cod sursa (job #2207731) | Cod sursa (job #1981149) | Cod sursa (job #3177631) | Cod sursa (job #179215) | Cod sursa (job #1325073)
/*
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 - 1];
}
int main()
{
Read();
return 0;
}