Cod sursa(job #2193547)
Utilizator | Data | 10 aprilie 2018 14:48:05 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.33 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
vector<int>v;
int main()
{
int n,k,x;
fin>>n>>k;
for(int i=1;i<=n;i++)
{
fin>>x;
v.push_back(x);
}
nth_element(v.begin(),v.begin()+k,v.end());
fout<<v[k-1];
return 0;
}