Cod sursa(job #1134543)
Utilizator | Data | 6 martie 2014 18:42:15 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.33 kb |
#include <stdio.h>
#include <algorithm>
using namespace std;
int N,K,V[3000005];
int main(){
freopen("sdo.in","r",stdin);
scanf("%d%d",&N,&K);
for( register int i = 1; i<=N; ++i )
scanf("%d",&V[i]);
nth_element(V+1,V+K,V+N+1);
freopen("sdo.out","w",stdout);
printf("%d",V[K]);
return 0;
}