Cod sursa(job #2717445)
Utilizator | Data | 7 martie 2021 14:08:33 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 50 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.54 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("sdo.in");
ofstream g("sdo.out");
vector < int > v;
void nos()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int n,k;
void read()
{
f>>n>>k;
int i;
for(i=1;i<=n;i++)
{
int x;
f>>x;
v.push_back(x);
}
}
void solve()
{
nth_element(v.begin(),v.begin()+k,v.end());
g<<v[k-1];
}
void restart()
{
}
int32_t main()
{
nos();
read();
solve();
restart();
return 0;
}