Cod sursa(job #1325070)
Utilizator | Data | 23 ianuarie 2015 11:02:18 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
/*
Rescriere OLI 2015
Start: 10:45
*/
#include <algorithm>
#include <iostream>
#include <fstream>
using namespace std;
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;
}