Cod sursa(job #881848)
Utilizator | Data | 18 februarie 2013 18:22:38 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.33 kb |
#include <cstdio>
#include <algorithm>
#define NMAX 300001
using namespace std;
int n,k,V[NMAX];
int main(){
freopen("sdo.in","r",stdin);
freopen("sdo.out","w",stdout);
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++)
scanf("%d",&V[i]);
nth_element(V+1,V+1+k,V+1+n);
printf("%d",V[k]);
return 0;
}