Cod sursa(job #424988)
| Utilizator | Data | 25 martie 2010 13:26:33 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.4 kb |
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
void open(){
freopen("sdo.in","r",stdin);
freopen("sdo.out","w",stdout);
}
int n,k,x[3000010];
int main(){
//open();
scanf("%d%d",&n,&k);k--;
for (int i=0;i<n;i++){
scanf("%d",&x[i]);
}
nth_element(x,x+k,x+n);
printf("%d\n",x[k]);
return 0;
}
