Pagini recente » Cod sursa (job #575744) | Cod sursa (job #1635211) | Cod sursa (job #1878498) | Cod sursa (job #1229604) | 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;
}