Cod sursa(job #1205837)
| Utilizator | Data | 8 iulie 2014 11:44:27 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.36 kb |
#include <algorithm>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
ifstream fin("sdo.in");
int n = 0, k = 0;
fin >> n >> k;
for (int i = 0; i < n; ++i)
{
int x = 0;
fin >> x;
v.push_back(x);
}
fin.close();
ofstream fout("sdo.out");
int res = nth_element(begin(v), end(v), k);
fout << res << '\n';
return 0;
}