Cod sursa(job #2104257)
Utilizator | Data | 11 ianuarie 2018 14:57:16 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
int V[3000005],N,K;
int main()
{
fin>>N>>K;
for(int i=1;i<=N;i++)
fin>>V[i];
nth_element(V+1, V+K, V+N+1);
fout<<V[K]<<'\n';
}