Cod sursa(job #1008854)
Utilizator | Data | 11 octombrie 2013 23:20:31 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include<fstream>
#include<algorithm>
using namespace std;
ifstream in("sto.in");
ofstream out("sto.out");
const int Nmax = 3000005;
int N,k,v[Nmax];
int main(){
in>>N>>k;
for(int i=1;i<=N;i++) in>>v[i];
nth_element(v+1,v+k,v+N+1);
out<<v[k];
return 0;
}