Pagini recente » Cod sursa (job #2159192) | Cod sursa (job #129120) | Cod sursa (job #632370) | Cod sursa (job #2271882) | Cod sursa (job #1325080)
/*
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;
th -= 1;
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;
}